Php 异步卷曲请求

Php 异步卷曲请求,php,curl,asynchronous,Php,Curl,Asynchronous,有人能帮我使这个函数异步工作吗 function connect($url, $para) { if (empty($para)) { return false; } $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER,

有人能帮我使这个函数异步工作吗

function connect($url, $para)
{
    if (empty($para)) {
        return false;
    }
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($para));
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
}
提前感谢您的帮助。

curl\u setopt($ch,CURLOPT\u FRESH\u CONNECT,true)


1.我做了我的研究,但没有成功。该请求被循环,直到响应正确为止。我对卷发一无所知,所以我希望有人能帮我。我不明白这怎么会太明显了?如果您不熟悉该框架,您如何知道您想要进行“新连接”以使其异步?在发布问题之前,我已经尝试过了。以下是整个脚本: