Skip to content

http_build_query(): surprise!

by Jonathon on September 30th, 2011

Did you know that PHP’s http_build_query() drops any key from your query array if the value is NULL? I wonder how many subtle API client bugs are caused by this behavior.

The workaround is easy, just set values that should be intentionally empty to boolean FALSE, integer 0, or an empty string.

From → Notebook

No comments yet

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS