1
是否有可能使用cURL在PHP中發送多關聯數組到頁面?PHP cURL是否可以傳遞一個多關聯數組?
我能夠傳遞一個數組,但會發生以下情況:
// Open Connection
$ch = curl_init();
// Set the URL
curl_setopt($ch, CURLOPT_URL, $this->config['submission']['eyerys']);
// Set the number of fields being sent:
curl_setopt($ch,CURLOPT_POST,count($this->call['info']));
// The string to send:
curl_setopt($ch,CURLOPT_POSTFIELDS,$string);
// Return transfer:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// SSL verification:
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
// Execute the post:
$result = curl_exec($ch);
$this->pre($result);
// Close connection:
$curl_close($ch);
我得到以下輸出:
Array
(
[info] => Array
[answers] => Array
[errors] => Array
)