PHP fileatime() 函数

PHP 教程 · 2019-01-24 22:14:34

定义和用法

fileatime() 函数返回指定文件的上次访问时间。

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

语法


fileatime(filename)


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

提示和注释

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

注释:文件的访问时间应该在不论何时读取了该文件中的数据块时被更改。部分 Unix 系统关闭访问时间更新,这是因为当一个应用程序定期访问大量文件时很影响性能,关闭访问时间更新可以提高这类程序的性能。USENET 新闻组假脱机是一个常见的例子。在这种文件系统下,本函数没有用处。

实例


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

上面的代码将输出:


1140684501
Last access: February 23 2006 09:48:21.


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

查看所有标签

The  C Programming Language

The C Programming Language

Brian W. Kernighan、Dennis M. Ritchie / Prentice Hall / 1988-4-1 / USD 67.00

Presents a complete guide to ANSI standard C language programming. Written by the developers of C, this new version helps readers keep up with the finalized ANSI standard for C while showing how to ta......一起来看看 《The C Programming Language》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具