This tutorial will show you how to display the date/time that the file was last modified.



Here you go, I commented each line, if you have a question don't hesitate to ask.


<?php

// The file that will you want to read the last modified time of.
$file = 'thefile.php';

// The variable that holds the function to display the date modified info.
$last_time_modified = filemtime($file);

// Format that time and date into a human readable format
$last_mod = "Page last edited " . date("m/j/y h:i", $last_time_modified);

// print the new formatted string and display the last modified info.
//You could also pass the "$last_mod" variable to another piece of your script
print $last_mod;

?>



That is the end of the tutorial. If you have a question feel free to contact me matt(at)mkeefedesign(dot)com.

Donated by <a href="http://mkeefedesign.com">mkeefe</a>