PHP Multiple Curl Requests

前端 未结 4 1120
后悔当初
后悔当初 2020-11-29 07:09

I\'m currently using Curl for PHP a lot. It takes a lot of time to get results of about 100 pages each time. For every request i\'m using code like this

$ch          


        
4条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 08:02

    • Reuse the same cURL handler ($ch) without running curl_close. This will speed it up just a little bit.
    • Use curl_multi_init to run the processes in parallel. This can have a tremendous effect.

提交回复
热议问题