PHP Tutorials

XMLStyleSoldierFlowerMonkey

Last Modified

Learn how to check when the file was last modified using power of PHP.

Spreadshirt
Alright, this is a simple little script which tells when the file was last modified using the PHP filemtime() function.
  1. Make the last modified variable and define the filetime() function.
  2. Echo out the date is was last modified..
Here it is in PHP:
<?

//where thefile.php is the current file
$last_modified = filemtime("thefile.php");

//print it all out
print("Last Modified ");
print(date("m/j/y h:i", $last_modified));

?>
See, its really easy to do in PHP :)

Discuss this tutorial »
Written by: Akash Goel
Back to PHP TutorialsTop


Copyright © 2000-2008 Spoono, LLC. All rights reserved.
Network: Reseller Web Hosting by Spoono Host | Spoonloads | Absolute Cross
Terms of Service | Privacy Policy.

kdfj