The filemtime() function is used to get the modification time of the file i.e., the time file was last modified.
Syntax:
filemtime($filename);
In above function there is only one parameter which is the name of the file you want to get the modification details. This function returns the last modification time of the file on success else false on failure.
For example:
Suppose we have a file name demo.txt and we need the modification time of the file.
<?php
$filename = 'demo.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
?>
0 Comment(s)