<?php if(@fsockopen("site.ru", "80", $errno, $errstr, 1)){ echo "online"; }else{ echo "offline"; } ?>