#Performs a cURL-Request to check, if a website exists / is online #3 #https://css-tricks.com/snippets/php/check-if-website-is-available/ <?php ini_set("default_socket_timeout","05"); set_time_limit(5); $f=fopen("http://www.css-tricks.com","r"); $r=fread($f,1000); fclose($f); if(strlen($r)>1) { echo("<span class='online'>Online</span>"); } else { echo("<span class='offline'>Offline</span>"); } ?>