且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

php发送curl请求并等待响应

更新时间:2022-06-01 05:20:35

curl正在阻止,这意味着:

curl is blocking, which means that:

$result = json_decode($ret,true);

foreach ($result['data'] as $key => $value)
{
      //process data from $result
}

将不会执行:

$ret = curl_exec($curl);

完成。您可以使用curl_error()和使用curl_getinfo()检查HTTP响应代码来检查错误和其他问题。

is complete. You can check for errors and other issues using curl_error() and by checking the HTTP response code with curl_getinfo().