$input = 'http://phpclub.ru';
function httpaddrcheck($input)
{
// 1 - found, 0 - not found, FALSE - error
$i = parse_url($input);
if ($i['scheme'] == 'http')
{
$path = $i['scheme'].'://'.$i['host'].$i['path'];
$fp = fopen($path,'r');
if (!$fp) {return 0;}
else
{
$meta = stream_get_meta_data($fp);
$headers = $meta['wrapper_data'];
return in_array('HTTP/1.1 200 OK',$headers)?1:0;
}
}
else {return FALSE;}
}
$result = httpaddrcheck($input);
var_dump($result);