stuckwithcode Posted October 4, 2010 Share Posted October 4, 2010 is this the best way to check if a server is live? <?php $host = "www.google.com"; $fp = fsockopen($host, 80, $errno, $errstr, 10); if($fp) { echo "yes it is"; fclose($fp); } else { echo "no it is not"; } ?> But if you type in a false server eg www.googddfsdfsd.com it returns an error how can i get it to return false and why doesn't it. Link to comment https://forums.phpfreaks.com/topic/215117-ping-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.