异步获取请求

Async get request

我正在寻找一种在 PHP 中使用回调执行异步 GET 请求的方法,类似于 JavaScript 的 fetch API:

fetch(url).then(Response => Response.text()).then(console.log);

我正在尝试这样做:

aysnc_gets($urls_array, {echo $result;});

或者我可以通过一个简单的循环一次发出一个异步请求。

我找遍了,没有发现任何有效的方法。我该怎么做?

I found this website that details curl_multi_* functions, which worked for me.