PHP filemtime() 函数

PHP 教程 · 2019-01-24 23:13:16

定义和用法

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

如果成功,该函数将以 Unix 时间戳形式返回文件内容的上次修改时间。如果失败,则返回 FALSE。

语法


filemtime(filename)


参数 描述
filename 必需。规定要检查的文件。

提示和注释

注释:该函数的结果会被缓存。请使用 clearstatcache() 来清除缓存。

实例


<?php
echo filemtime("test.txt");
echo "<br />";
echo "Last modified: ".date("F d Y H:i:s.",filemtime("test.txt"));
?>

上面的代码将输出:


1139919766
Last modified: February 14 2006 13:22:46.


点击查看所有 PHP 教程 文章: https://www.codercto.com/courses/l/5.html

查看所有标签

Learning Python, 5th Edition

Learning Python, 5th Edition

Mark Lutz / O'Reilly Media / 2013-7-6 / USD 64.99

If you want to write efficient, high-quality code that's easily integrated with other languages and tools, this hands-on book will help you be productive with Python quickly. Learning Python, Fifth Ed......一起来看看 《Learning Python, 5th Edition》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

在线进制转换器
在线进制转换器

各进制数互转换器

URL 编码/解码
URL 编码/解码

URL 编码/解码