我有简单的数组;
[specifics] => Array
(
[0] => RT
[1] => 2S
)
然后我创建它来查询;
http_build_query($array);
specifics%5B0%5D=RT&specifics%5B1%5D=2S
两者都不起作用。
curl_setopt($ch3, CURLOPT_HEADER, 1);
curl_setopt($ch3, CURLOPT_HTTPHEADER, array("Content-type: multipart/form-data"));
curl_setopt($ch3, CURLOPT_URL, $info2['url']);
curl_setopt($ch3, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch3, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch3, CURLOPT_POST, 1);
curl_setopt($ch3, CURLOPT_POSTFIELDS, $query);
这是我正在使用的代码。
答案 0 :(得分:0)
某些远程服务器无法识别查询中的“%5B0%5D”
specifics%5B0%5D=RT&specifics%5B1%5D=2S
尝试以下
http_build_query($array, '', '&');