阅读背景:

curl模拟多线程异步提交

来源:互联网 
实现思路:将超时时间设置毫秒级别,只提交数据 不等待返回结果:
        $ch = curl_init($url);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_NOSIGNAL, true);    //注意,毫秒超时一定要设置这个
        curl_setopt($ch, CURLOPT_TIMEOUT_MS, 100); //超时时间100毫秒
        curl_exec($ch);
        curl_close($ch);        $ch =



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: