<? 
$site = "codelibary.com";
$check = fsockopen($site, 80);

if ($check) {
    echo "$site is online";
}
else {
    echo "$site is offline";
}
?>
Published in: PHP
Download

Related snippets