Red Wingate wrote:
http://de.php.net/filemtime

[quote]
As of PHP 5.0.0 this function can also be used with some URL wrappers. Refer to Appendix J for a listing of which wrappers support stat() family of functionality.
[/quote]


-- red

As you likely don't have PHP5 installed, use fsockopen, filesystem functions to send and receive HEAD request, regexp to get Last-Modified header (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.29) and strtotime to get unix timestamp.


Working example (I hope):

<?php
$fp = fsockopen("www.abc.com", 80, $errno, $errstr, 30);
if (!$fp) {
   echo "$errstr ($errno)<br />\n";
} else {
   $out = "HEAD /abc/Test.zip HTTP/1.1\r\n";
   $out .= "Host: www.abc.com\r\n";
   $out .= "Connection: Close\r\n\r\n";

   fwrite($fp, $out);
   while (!feof($fp)) {
       fgets($fp, 1024);
       if(ereg('^Last-Modified:\s+([^\r]+)', $m)) {
           echo strtotime($m[1]);
           break;
       }
   }
   fclose($fp);
}
?>

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to