如何编写异步PHP代码
作者:互联网
我有一些代码可以执行以下伪代码:
Use CURL to get site1 into a variable
Use CURL to get site2 into a variable
Use CURL to get site3 into a variable
Use CURL to get site4 into a variable
Do lots of processing on each
Produce output
echo output
当前,这偶尔需要很长时间.
我想让CURL位并行运行,以便加快运行速度.
我怎么做?
解决方法:
我认为您正在寻找此http://php.net/manual/en/function.curl-multi-init.php并行cURL请求.
标签:asynchronous,parallel-processing,php 来源: https://codeday.me/bug/20191202/2086123.html