In this chapter we will learn filemtime() PHP function, this will return date and time the last time a file was modified on the website. 


example:

<?php

// outputs myfile.txt was last modified: December 29 2002 22:16:23.
$filename = 'myfile.txt';
if (file_exists($filename)) {
    echo "$filename was last modified: " . date("F d Y H:i:s.", filemtime($filename));
}
?>


Output:

myfile.txt was last modified: December 29 2002 22:16:23.


Thanks, May this example help you.