Home Tutorial Php Phpfiles PHP filemtime() Function and examples

 
 

PHP filemtime() Function and examples
Posted on: October 29, 2009 at 12:00 AM
In this section of PHP tutorial, we will learn How to use the PHP filetime()function with example.

Syntax

  • 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

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

Output

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

Related Tags for PHP filemtime() Function and examples :


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.