Share on Google+Share on Google+

PHP filemtime() Function and examples

In this section of PHP tutorial, we will learn How to use the PHP filetime()function with example.


  • int filemtime(file_name)
  • Gives the modification time in integer form of the file
  • Use Date() function to change it to proper format

PHP filemtime() function Example

    $time = time();
"current date and times is ".date("m/d/y H:i:s ", $time);
"<br>current File Modification Time is ".date("m/d/y H:i:s ", filemtime("c:/rose1/ram.txt"));


current date and times is 09/10/09 11:47:21
current File Modification Time is 09/10/09 09:44:15


Posted on: October 29, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.