Hi @ all
I like to ping multiple servers to get their response time and to know if they are online. The urls are stored in a DB, and I have them in the variable $domain. Til now I´m doing that with this script:
$url = "ping -c 1 ".$domain;
$ping = exec($url, $result, $error);
preg_match("=([\d.]+)/([\d.]+)/([\d.]+) ms=", $ping, $matches);
if(empty($matches[2])) {
echo "offline";
} else {
echo "online ".$matches[2];
}
It works good with 1 or 2 urls, but if there are 10 or more urls, I´ve to wait very long, and mostly I get execution-time errors.
Is there any way to ping the urls simultaniously?
Thanks in advance
thesilencer