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).

Entrées correspondantes:
VaudTax sous Linux
Gentoo: access violation summary
Flash Player 9 pour Linux
Gentoo on my T60p
Self-Signed certificat
Commentaires (0) Permalink