Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Builder.com:
Pinging with PHP and PEAR
Jul 01, 2004 @ 12:03:05

On Builder.com today, there's a new article about creating a script to ping a remote host with PHP.

If you're building a distributed PHP-based Web application, there may come a time when you'll need to ping a remote host. Maybe it's just to see if the host is alive before redirecting a browser, or to see if a remote service is up and running. The PHP Extension and Application Repository (PEAR) has a handy Net/* hierarchy that makes it a cinch, specifically the Net_Ping class.

They give a simple example for this simple concept, showing how to ping, check for errors, and echo the response. Other useful classes in the hierarchy besides Net_Ping(), including support for traceroute and DNS functions.

tagged:

Link:


Trending Topics: