<?php
   function getheaders($url,$format=0)
   {
       $url_info=parse_url($url);
       $port = isset($url_info['port']) ? $url_info['port'] : 80;
       if($fp=@fsockopen($url_info['host'], $port, $errno, $errstr, 30)){
      
       if($fp)
       {
           $head = "HEAD ".@$url_info['path']."?".@$url_info['query']." HTTP/1.0\r\nHost: ".@$url_info['host']."\r\n\r\n";     
           fputs($fp, $head);     
           while(!feof($fp))
           {
               if($header=trim(fgets($fp, 1024)))
               {
                   if($format == 1)
                   {
                       $key = array_shift(explode(':',$header));
                       // the first element is the http header type, such as HTTP 200 OK,
                       // it doesn't have a separate name, so we have to check for it.
                       if($key == $header)
                       {
                           $headers[] = $header;
                       }
                       else
                       {
                           $headers[$key]=substr($header,strlen($key)+2);
                       }
                       unset($key);
                   }
                   else
                   {
                       $headers[] = $header;
                   }
               }
           }
           return $headers;
       }
       else
       {
           return false;
       }
       }else{
       $headers[0] = '12007 The server name could not be resolved';
       return $headers;
       }
   }

$array = array('http://www.phphulp.nl/','http://www.interrob.de','http://clubphp.phphulp.nl','http://www.phphulp.nl/faiejfeifjew.html');
for($i = 0;!empty($array[$i]);$i++){
$headers = getheaders($array[$i]);
echo $array[$i].' Melding: '.$headers[0].'<br />';
}
?>