>> KYSCORP.COM TUTORIALS >> PHP Tutorials

Last Modified

An easy and efficient way to write the date a file was last modified.
We call the function filemtime() that returns an integer (the number of seconds elapsed from Jan 1st, 1970 00:00 GMT)
Anyway, to make this integer viewable by human beings, we just format it using date() function.

<?
$file=$PHP_SELF; //Here's the file you wish to include. $PHP_SELF means current page
$mt=filemtime($file);
echo "This page was last modified on ".date("l F, d Y",$mt);
?>