當使用curl傳遞post數據時 , 數據的字段如果是個數組,就會報錯Array to string conversion
在調用curl_setopt_array($curl, $options);
調用curl_setopt($ch, CURLOPT_POSTFIELDS, $data)
這兩處地方都可能會報錯 , 解決辦法是把數據數組處理一下
http_build_query($data)
當使用curl傳遞post數據時 , 數據的字段如果是個數組,就會報錯Array to string conversion
在調用curl_setopt_array($curl, $options);
調用curl_setopt($ch, CURLOPT_POSTFIELDS, $data)
這兩處地方都可能會報錯 , 解決辦法是把數據數組處理一下
http_build_query($data)
https://stackoverflow.com/questions/419163/what-does-if-name-main-do