You'd have to use fputs and use:
GET / HTTP/1.0
then just grab the headers from the response.... Here's something I whipped up real quick. It kinda works. Needs a little tweaking though... but this should get you going in the right direction...
<?php
$output = '<html>
<head>
<title>Server Information 101</title>
<style type="text/css"><!--
#wrapper{width:800px;margin:10px auto;padding:0;border:1px solid #000;}
#message{width:800px;margin:0 0 15px 0;padding:0;border-bottom:1px solid #000;position:relative;float:left;}
#message.error{background-color:#ff6a6a;color:#000;}
#message.info{background-color:#eaeaae;color:#000;}
#message h3{width:780px;text-align:left;position:relative;float:left;margin:10px;padding:0;}
#message p{width:750px;text-align:left;position:relative;float:left;margin:0 25px 10px 25px;paddign:0;}
#form{width:790px;margin:10px;padding:0;text-align:left;position:relative;float:left;}
#clearer{clear:both;width:100%;height:0;visibility:hidden;}
--></style>
</head>
<body>
<div id="wrapper">';
if(isset($_POST) && !empty($_POST) && isset($_POST['host']) && !empty($_POST['host']))
{
$url = substr($_POST['host'], 0, 7) == 'http://' ? substr($_POST['host'], 7) : $_POST['host'];
$url = substr($url, 0, 4) == 'www.' ? $url : 'www.'.$url;
$fh = @fsockopen($url, 80, $errno, $errstr, '20');
if($fh === false)
{
$output .= '<div id="message" class="error"><h3>Connection Error</h3><p>An error occurred during connection to the server (<em>' . $url . '</em>). The error returned was the following:<br />Error #' . $errno . ':<br />' . $errstr . '</p></div>';
}
else
{
$output .= '<div id="message" class="info"><h3>Server Information For: <em>'. $url . '</em></h3>
<p style="white-space:pre;">';
$tmp = '';
$send = "GET / HTTP/1.0\r\n";
$send .= "Host: " . substr($url, 4) . "\r\n";
$send .= "Connection: Close\r\n";
fwrite($fh, $send);
while(!feof($fh))
$tmp .= fgets($fh, 1024);
@list($headers, $body) = @explode("\r\n\r\n", $tmp);
$output .= $headers;
$output .= '</div>';
}
@fclose($fh);
}
$output .= '<div id="form">
<form action="' . $_SERVER['PHP_SELF'] . '" method="post">
<label for="iHost">Web Server URL</label>: <input type="text" name="host" value="www." />
<input type="submit" value="Go -->" name="submit" />
</form>
</div>
<div id="clearer"></div>
</div>
</body>
</html>';
echo $output;
?>