[ Examples with filemtime ] PHP 3, PHP 4, PHP 5
int filemtime ( string filename )
filemtime returns the last modification of the file filename , or FALSE on error.
filemtime returns the time of writing file data blocks. Use date of the result to get a human readable date of modification.
Example filemtime:
<? Php
/ / the output is: somefile.txt was last modified: December 29 2002 22:16:23.
$ filename = 'somefile.txt' ;
if ( file_exists ( $ filename )) {
echo "$ filename has been modified: " . date ( "F d YH: i: s." , filemtime ( $ filename ));
}
?>
Note
The results of this function are cached. See the function clearstatcache for more details.
Array
See also filectime , stat , touch and getlastmod .
|