<?php
$hostname = "localhost";
$httpport = 80;
$fp = fsockopen ($hostname, $httpport, $errno, $errstr, 30);
$str = "";
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
fputs ($fp, "HEAD /index.html HTTP/1.0\r\n\r\n");
while (!feof($fp)) {
$str .= fgets ($fp,128);
}
fclose ($fp);
}
$tmp = ereg("Last-Modified: ([^\r]+)", $str, $match);
$lastmod = $match[1];
echo $lastmod . "<br><hr>\n";
?>