note 29836 added to function.exec

From: Date: Wed, 26 Feb 2003 13:51:20 +0000
Subject: note 29836 added to function.exec
Groups: php.notes 
Request: Send a blank email to php-notes+get-44554@lists.php.net to get a copy of this message
I wrote a simple ping user function, useful for automatically determining wether to show high bandwidth content or calculating download times. function PingUser() { global $REMOTE_ADDR; return ereg_replace(" ms","",end(explode("/",exec("ping -q -c 1 $REMOTE_ADDR")))); } It returns a number representing the milli seconds it took to send and receive packets from the user. -- http://www.php.net/manual/en/function.exec.php http://master.php.net/manage/user-notes.php?action=edit+29836 http://master.php.net/manage/user-notes.php?action=delete+29836 http://master.php.net/manage/user-notes.php?action=reject+29836

« previous php.notes (#44554) next »