http_build_query 的一个问题
当我们使用CURL来post数据的时候,需要设置post的数据 curl_setopt($c, CURLOPT_POSTFIELDS, $post_data); 假如这里的$data是 $data = array( \'name\'=>\'scofield\', \'time\'=>\'2012-2-3\' ) 接下来,需要先将$data变成字符串 $post_data = http_build_query($data); 而采用 http_build_query 转换后再 curl_setopt($c, CURLOPT_POSTFIELDS, $post_data); 看起来没有什么问题。但在实际操作中,$post_data 并没有被post过去。于是,自己写了个转换的方法后就OK了。 function getStr($array,$Separator=\'&\') { if