PHP中的fileatime()函数
该fileatime()函数返回文件的最后访问时间。它返回文件的上次访问时间作为UNIX时间戳。失败时返回false。
语法
fileatime ( file_path );
参数
file_path-将找到其最后访问时间的文件的路径。
返回
该fileatime()函数将文件的最后访问时间作为UNIX时间戳返回。失败时返回false。
示例
<?php
echo fileatime("new.txt");
?>输出结果
1315416291
现在让我们以人类可读的形式获取最后访问时间作为日期。
示例
<?php
echo "Last access time of the file: ".date("F d Y H:i:s.",fileatime("new.txt"));
?>输出结果
Last access time of the file: September 22 2018 11:23:52
热门推荐
10 儿子立冬祝福语简短独特
11 对当兵的祝福语简短
12 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短