Ping server script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jeff177
Forum Newbie
Posts: 2
Joined: Thu Mar 18, 2004 2:20 pm

Ping server script

Post by jeff177 »

Im a noob when it comes to coding and i was wondering if anyone had any ideas on a script to ping a game server and show the output on site. I just want it to automatically ping when you go on the page and show it.

I know
$is_active = ping('server_address') which returns either true or false, but is there a way to get the numerical ping.
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post by xisle »

try executing a shell command

Code: Select all

exec("ping yourip", $resultarray);
Post Reply