Right now I am using cURL and something like that:
foreach ($urls as $url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
}
to trigger a php script on a remote server.
My thing is I just want to trigger that script and doesn't care at all what it returns and I want to trigger another address that is in my loop.
So, how can I eliminate waiting for the response and just trigger the scripts on the servers (I have about 200 urls in my array I need to loop through and trigger each of these urls).
So, basically I want just to trigger the script and move to the next one and don't care what it returns.
And another concern of mine is that if I can move the curl_init()
outside of the loop like that:
$ch = curl_init();
foreach ($urls as $url) {
curl_setopt($ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
}
If there is a faster way how to achieve this without using cURL, please let me know. I just need to trigger 100 scripts on remote servers from one loop inside one file.