I have an array with 12500 elements (company IDs). I need run 1 PHP file for all the elements in the array.
Please let me know what is the best way to do that.
I want to use Curl inside the for each loop to execute the file:
<?php
$array = ['123','124','125','126','127',......,'12503'];
foreach ($array as &$value) {
$url = 'https://*****/*****/List_daily.php?accountid='.$value.'';
$resp = call_curl($url);
echo $resp."<br>"
/**
Here is where I want to execute the file
**/
}
function call_curl($url){
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_TIMEOUT => '5'
));
$resp = curl_exec($curl);
curl_close($curl);
return $resp;
}
?>