Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php get last modified date of file

$filename = 'somefile.txt';
if (file_exists($filename)) {
    echo "$filename last modified: ".date ("F d Y H:i:s.", filemtime($filename));
  	// somefile.txt was last changed: December 29 2020 22:16:23.
}
// filectime: when created
// filemtime: last modified
// fileatime: last accessed
 
PREVIOUS NEXT
Tagged: #php #modified #date #file
ADD COMMENT
Topic
Name
5+2 =