php - http_build_query not correctly encoding my post fields -
it's strange issue i'm facing. here curl request i'm sending:
$fields = array( 'action' => 'json', 'region' => '', 'states' => array('tx'), 'start' => '4/2/2010', 'end' => '4/2/2017', 'internalcomments' => 'no' ); $fields_string = http_build_query($fields); $ch = curl_init($url); curl_setopt($ch,curlopt_returntransfer, true); curl_setopt($ch,curlopt_post, count($fields)); curl_setopt($ch,curlopt_postfields, $fields_string); $jsonresult = curl_exec($ch); curl_close($ch);
however, when i'm printing out content of $fields_string
, see trademark icon in query string:
action=json®ion=&states%5b0%5d=al&states%5b1%5d=tx&start=04%2f01%2f2010&end=04%2f07%2f2017&internalcomments=no
notice ® icon after word json? idea that's coming from?
Comments
Post a Comment