note 108215 deleted from function.http-build-query by hholzgra
| From: | hholzgra@php.net | Date: | Thu, 02 Aug 2012 13:42:41 +0000 |
| Subject: | note 108215 deleted from function.http-build-query by hholzgra | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-189781@lists.php.net to get a copy of this message | ||
Note Submitter: tarwin at gmail dot com
----
When using 'http_build_query' with an associative array, and then passing this to the end
of a URL when using cURL I was only getting the first parameter through.
For some insane reason it was giving me back:
var1=hello&var2=world
instead of:
var1=hello&var2=world
I took a stupid amount of time to work out what was going wrong, but it was easy to fix with this.
<?php
str_replace('&', '&', http_build_query($myVars));
?>