What I ended up coming up with is as follows:
function ping($link) {
$link = preg_replace('![url]http://www.[/url]!','',$link);
$link = preg_replace('/:.*/','',$link);
$cmd = `ping -c1 -w1 $link`;
if (preg_match('!time=(.+) ms!', $cmd, $m)) {
print "<font color='lime'><strong>ALIVE</strong></font> (".$m[1] . "ms)";
} else {
print "<font color='red'><strong>DEAD</strong>";
}
}
This shows only the ping in terms of #ms ...
I'm sure some of you will find it helpful.