11 Eylül 2007 Salı

Last Modifiled Header in PHP

The last modified http header indicates the date and time the resource was last modified. For a file it is the date and time it was last modified.

First get the date and time of the file in GMT
$date=gmdate("D, d M Y H:i:s",filemtime($_SERVER['SCRIPT_FILENAME']))." GMT";

Sends the Last Modified header to the client
header("Last-Modified: ".$date);

Hiç yorum yok: