<?php
$host = 'http://google.com';
if($socket =@ fsockopen($host, 80, $errno, $errstr, 30)) {
echo 'online!';
fclose($socket);
} else {
echo 'offline.';
?>
I'm using the above program to get the status of site. But I always get an offline message. Is there any mistake with the code?
See Question&Answers more detail:os