目录

PHP filemtime() 函数

❮ PHP 文件系统参考

示例

获取文件内容最后一次修改时间:

<?php
echo filemtime("webdictionary.txt");
echo "<br>";
echo "Content last changed: ".date("F d Y H:i:s.", filemtime("webdictionary.txt"));
?>
运行示例 »

定义和用法

filemtime() 函数返回上次修改文件内容的时间。

笔记:该函数的结果被缓存。使用清除统计缓存()清除缓存。

语法

filemtime( filename)

参数值

Parameter Description
filename Required. Specifies the path to the file to check


技术细节

返回值: 上次将文件内容修改为 Unix 时间戳,失败时为 FALSE
PHP 版本: 4.0+

❮ PHP 文件系统参考