PHP cURL required only to send and not wait for response

前端 未结 6 1876
被撕碎了的回忆
被撕碎了的回忆 2020-12-09 09:11

I need a PHP cURL configuration so that my script is able to send requests and ignore the answers sent by the API.

curl_setopt($ch,CURLOPT_URL,$url);
curl_se         


        
6条回答
  •  被撕碎了的回忆
    2020-12-09 09:37

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
    curl_setopt($ch, CURLOPT_TIMEOUT_MS, 1);
    curl_exec($ch);
    curl_close($ch);
    

    That works well for me.
    Tested on PHP 7.1.14 Windows

提交回复
热议问题