When initiating batch requests, can curl_multi_ Exec` end all requests when the first request is obtained?

curl_multi_exec you can initiate batch requests. For example, I initiate 10 requests at the same time, and when I receive the first request, all requests are terminated, regardless of whether the subsequent requests are successful or not.

Mar.04,2021

you can use curl_multi_remove_handle to remove the other nine, and then curl_multi_close .


you need to judge the result of the curl_multi_exec execution of the first cURL handle, and then remove and close

.
curl_multi_remove_handle($mh, $ch1);
curl_multi_remove_handle($mh, $ch2);
'''
curl_multi_remove_handle($mh, $ch10);
curl_multi_close($mh);
Menu