How to get modified time and size of any file using PHP?
How to get modified 开发者_StackOverflowtime and size of any file using PHP?
SplFileInfo provides a high level API to the file system:
$file = new SplFileInfo('path/to/file');
echo $file->getMTime();
echo $file->getSize();
From php.net http://us.php.net/manual/en/function.stat.php
stat
(PHP 4, PHP 5)
stat — Gives information about a file
you can use this
echo date("m/d/Y",filemtime("latestime.php"));
You can use filemtime
and filesize
functions for that.
More info here
精彩评论