libcurl - PHP curl_multi_init change proxy

I would like to make some simultaneous requests withcurl_multi_init
using proxies but I don't know how to check in a request if the proxy is banned and then change the proxy and restart the request.
Thank you
My code :
<?php
$thread = [];
for($i = 0; $i < 50; $i++)
{
$thread[$i] = curl_init('https://www.whatismybrowser.com/detect/what-http-headers-is-my-browser-sending');
curl_setopt($thread[$i], CURLOPT_HEADER, 0);
curl_setopt($thread[$i],CURLOPT_SSL_VERIFYPEER,false);
}
$mh = curl_multi_init();
for($i = 0; $i < 50; $i++)
{
curl_multi_add_handle($mh,$thread[$i]);
}
do {
$status = curl_multi_exec($mh, $active);
if ($active) {
curl_multi_select($mh);
}
} while ($active && $status == CURLM_OK);
curl_multi_close($mh);
?>
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: cannot set properties of undefined (setting '_dt_cellindex')
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.