异步获取请求

问题描述

我正在寻找一种在 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.