Answers for "how to get file datetime in php"

PHP
0

php get file created date

$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
Posted by: Guest on April-07-2021

Code answers related to "how to get file datetime in php"

Browse Popular Code Answers by Language