Forum Moderators: coopster

Message Too Old, No Replies

Check if host is reachable?

Can php check if remote host is reachable?

         

sunroof

11:22 pm on Mar 11, 2006 (gmt 0)

10+ Year Member



Does php have ability to check whether a website on the remote host is reachable or not?

Thanks.

appi2

3:30 am on Mar 12, 2006 (gmt 0)

10+ Year Member



<?php
$file = fopen ("http://www.example.com/", "r");
if (!$file) {
echo "<p>Unable to open remote file.\n";
exit;
}

many other ways.