开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜