How does PHPCURL support multi-dimensional array transfer? $ _ GetData [& #039; test & #039;] [& #039; name & #039;] [& #039; ec & #039;] & #039; egeer & #039; {code ...} http_build_query: this function can only support 3-dimensional arrays. Write four-dimensional arrays $ _ getData [& #039; test & #039;] [& #039; name & #039;] [& #039; ec & #039;] [& #039; php & #039;] & #039; egeer & #039 ;; how does php curl support multi-dimensional array transfer?
$ _ GetData ['test'] ['name'] ['EC'] = 'eger ';
// Curl GET + POST submit public function filePostContents ($ url, $ data) {$ ch = curl_init (); curl_setopt ($ ch, CURLOPT_URL, $ url ); curl_setopt ($ ch, CURLOPT_POST, 1); curl_setopt ($ ch, CURLOPT_COOKIESESSION, 1); curl_setopt ($ ch, scheme, http_build_query ($ data); curl_setopt ($ ch, CURLOPT_TIMEOUT, 600); // curl_setopt ($ ch, CURLOPT_USERAGENT, _ USERAGENT _); // curl_setopt ($ ch, CURLOPT_REFERER, _ REFERER _); curl_setopt ($ ch, expires, expires, 1); $ r = curl_exec ($ ch); curl_close ($ ch); return $ r ;}
Http_build_query: this function can only support 3-dimensional arrays.
Write a four-dimensional array $ _ getData ['test'] ['name'] ['EC'] ['php'] = 'eger ';
Cannot use string offset as an array I
Reply content:
How does php curl support multi-dimensional array transfer?
$ _ GetData ['test'] ['name'] ['EC'] = 'eger ';
// Curl GET + POST submit public function filePostContents ($ url, $ data) {$ ch = curl_init (); curl_setopt ($ ch, CURLOPT_URL, $ url ); curl_setopt ($ ch, CURLOPT_POST, 1); curl_setopt ($ ch, CURLOPT_COOKIESESSION, 1); curl_setopt ($ ch, scheme, http_build_query ($ data); curl_setopt ($ ch, CURLOPT_TIMEOUT, 600); // curl_setopt ($ ch, CURLOPT_USERAGENT, _ USERAGENT _); // curl_setopt ($ ch, CURLOPT_REFERER, _ REFERER _); curl_setopt ($ ch, expires, expires, 1); $ r = curl_exec ($ ch); curl_close ($ ch); return $ r ;}
Http_build_query: this function can only support 3-dimensional arrays.
Write a four-dimensional array $ _ getData ['test'] ['name'] ['EC'] ['php'] = 'eger ';
Cannot use string offset as an array I
Why do we need to pass multi-dimensional arrays, convert them to json, and convert them to arrays when accepting them?
Multi-dimensional arrays cannot be passed.
This structure is amazing.
Upload the data in json as described above ~~
First into a string, if the field also pay attention to the format