我正在寻找一种在 PHP 中使用回调执行异步 GET 请求的方法,类似于 JavaScript 的 fetch API:
fetch
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.
curl_multi_*