Home > php教程 > php手册 > body text

php filemtime -取得文件修改时间

WBOY
Release: 2016-06-13 11:17:33
Original
1250 people have browsed it

php filemtime -取得文件修改时间  

filemtime
( PHP 4中, PHP 5中)

filemtime -取得文件修改时间

描述
国际filemtime (字符串$文件名)
这个函数返回时,数据块的文件被写入,这就是当时的内容文件改变。

参数

文件名
文件路径。


返回值
返回时间的文件的最后修改,或FALSE的情况下发生错误。返回的时间是作为一个Unix的时间戳,这是合适的日期( )函数。

实例

例如# 1 filemtime ( )的例子

// outputs e.g.  somefile.txt was last modified: December 29 2002 22:16:23.

$filename = 'somefile.txt';
if (file_exists($filename)) {
    echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
?>


Related labels:
source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template