Swoole\Runtime::enableCoroutine(true, SWOOLE_HOOK_ALL | SWOOLE_HOOK_CURL);
for ($i = 0; $i <= 20; $i++) {
go(function () use ($i){
// sleep(2);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://116.62.45.127/index.php?a='.$i);
curl_setopt($ch, CURLOPT_HEADER,0);
curl_exec($ch);
curl_close($ch);
});
};
网友评论