Home  >  Article  >  Backend Development  >  php获取文件创建时间、批改时间

php获取文件创建时间、批改时间

WBOY
WBOYOriginal
2016-06-13 10:58:141013browse

php获取文件创建时间、修改时间

php获取文件创建时间、修改时间

filemtime ( string filename )

返回文件上次被修改的时间,出错时返回 FALSE。时间以 Unix 时间戳的方式返回,可用于 date()。

例如:$a=filemtime("log.txt");
?????????? echo "修改时间:".date("Y-m-d H:i:s",$a)."

filectime ( string filename )

返回文件上次 inode 被修改的时间,如果出错则返回 FALSE。时间以 Unix 时间戳的方式返回。

例如:$a=filectime("log.txt");
?????????? echo "创建时间:".date("Y-m-d H:i:s",$a)."

fileatime ( string filename )

返回文件上次被访问的时间,如果出错则返回 FALSE。时间以 Unix 时间戳的方式返回。

例如:$a=fileatime("log.txt");
????????? echo "修改时间:".date("Y-m-d H:i:s",$a)."

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn