I need to generate requests to several APIs, get response from them and then generate a report.
something like this:
foreach($api_array as $api){
echo $api;
$responce = file_get_contents($api);
if($responce)
echo 'ok <br/>';
else
echo 'fail <br/>';
}
It's obvious that when run consistently, one by one, this will take A LOT of time to wait for each service to respond.
Can this be done asynchronously, like in JavaScript? Thanks a lot!