Try this,
PHP:foreach($urls as $url) { $headers = get_headers($url, true); if (!preg_match('/ok/i', $headers[0])) { print $url . ' ' $header[0]; } }
/* $urls is an array of the websites you want to check */
$urls = array('http://example.com/', 'http://acmedomains.com/', 'http://this-domain-dosent-exisit.info');
/* loop through each url in $urls */
foreach($urls as $url)
{
/* just get the http headers, not the whole page to save time */
!$headers = get_headers($url, true);
/* Check if response header is 'OK', other wise print the error message */
if (!is_array($headers) || !preg_match('/ok/i', $headers[0]))
{
print "{$url}\n";
}
}


