= 5 ) { $headers = get_headers("$url[scheme]://$url[host]:$url[port]$path"); } else */ { $fp = fsockopen($url['host'], $url['port'], $errno, $errstr, 30); if ( ! $fp ) return false; fputs($fp, "HEAD $path HTTP/1.1\r\nHost: $url[host]\r\n\r\n"); $headers = fread ( $fp, 128 ); fclose ( $fp ); } $headers = ( is_array ( $headers ) ) ? implode ( "\n", $headers ) : $headers; $end = microtime(); $start = explode(" ",$start); $end = explode(" ",$end); $diff = ($end[0] + $end[1]) - ($start[0] + $start[1]); logPinging(" pinging took: ".$diff); return ( bool ) preg_match ( '#^HTTP/.*\s+[(200|301|302)]+\s#i', $headers ); } $end = microtime(); $start = explode(" ",$start); $end = explode(" ",$end); $diff = ($end[0] + $end[1]) - ($start[0] + $start[1]); logPinging(" (in return always false) pinging took: ".$diff); return false; } ?>