I have something that does work reasonably well if you have write permissions to your web server. Maybe you can modify it for your needs.
--
<?php
$ping_id=$HTTP_ENV_VARS["REMOTE_ADDR"];
system("ping ".$ping_id." -n 4 > logfile");
$fpr=fopen("logfile", "r") or die("Cannot ping machine");
$datain=fread($fpr, filesize("logfile"));
fclose($fpr);
$lines=explode("\n", $datain);
$lastline=$lines[(count($lines)-2)];
echo "The ping time to our network from ip address ".$ping_id." is ";
echo $lastline
?>
--
or from php 4.2 under linux
--
<?php
$ping_id=$_ENV["REMOTEHOST"];
system("ping ".$ping_id." -c 4 > ./logfile");
$fpr=fopen("./logfile", "r") or die("Cannot ping machine");
$datain=fread($fpr, filesize("./logfile"));
fclose($fpr);
$lines=explode("\n", $datain);
$lastline=$lines[(count($lines)-2)];
echo "The ping time to our network from ip address ".$ping_id." is ";
echo $lastline
?>
--
These have worked for me I hope these help
Mark.