Content-Length is the file size. Therefore, you can obtain the file size echostrtotime ($ headInf ['last-modified']) from the file header. // output the Last UNIX timestamp.
$ Url = 'http: // www.js4j.com/index.html ';
$ HeadInf = get_headers ($ url, 1); // get the file header information
Print_r ($ headInf); // Print the file header information
Echo "\ n ";
Echo $ headInf ['last-modified']; // The Last update time of the output file.
Echo "\ n ";
Echo strtotime ($ headInf ['last-modified']); // output the UNIX timestamp of the Last update time.
?>
Running result:
Content from js4j.com
Array
(
[0] => HTTP/1.0 200 OK
[Date] => Thu, 24 Apr 2008 12:12:31 GMT
[Server] => Apache/2.0.54 (Unix)
[Last-Modified] => Wed, 23 Apr 2008 16:49:41 GMT
[ETag] => "c3fdc1-1bd6-1e7fb340"
[Accept-Ranges] => bytes
[Content-Length] = & gt; 7126
[Content-Type] => text/html
[Age] = & gt; 11394
[X-Cache] => HIT from webfront4.js4j.com.cn
[Connection] => close
)
Wed, 23 Apr 2008 16:49:41 GMT
1208969381
Content-Length is the file size, so you can get the file size from the file header.