parse_str appending ampersand to elements?
<p>I've been playing around with cURL, and am trying to send an array through as POST variables. I've decided to use http_build_query to pass the string as expected: </p>

<pre><code>curl_setopt($this-&gt;ch, CURLOPT_POSTFIELDS, http_build_query($sendParams));
</code></pre>

<p>I have the receiving end simply <code>print_r</code>'ing the $_POST, so I can see what is being sent through.</p>

<p>However, I am getting an ampersand attached to all of the parent elements <em>after</em> the first, is this normal? I assume that parse_str is used by cURL when parsing the querystring, so here is a super-simplified example that also leads to the ampersands:</p>

<pre><code>&lt;?php
    $array = array('foo', array('bar' =&gt; array('baz' =&gt; array(1,2,3))), 'test' =&gt; array(2,3,4));
    parse_str(http_build_query($array), $vars);
    print_r($vars);
?&gt;
</code></pre>

<p>Returns:</p>

<pre><code>Array ( [0] =&gt; foo [amp;1] =&gt; Array ( [bar] =&gt; Array ( [baz] =&gt; Array ( [0] =&gt; 1 [1] =&gt; 2 [2] =&gt; 3 ) ) ) [amp;test] =&gt; Array ( [0] =&gt; 2 [1] =&gt; 3 [2] =&gt; 4 ) ) 
</code></pre>
