Test host availability
If you want testing host availability:
function hostLive($host) {
$ckhost = @fsockopen($host, 80, $errno, $errstr, 30);
return ($ckhost) ? 1 : 0;
}
$my_host = "www.counter-strike.net";
echo (hostLive($my_host) ? "$host is UP :-)" : "$host is DOWN!";
This solution is very useful with host that don't accept ICMP request (ping).


