fileatime
fileatime返回文件上次被访问的时间, 或者在失败时返回 FALSE 。时间以 Unix 时间戳的方式返回。
实例:
<?php
$file = \"test.txt\";
outputFileTestInfo( $file );
function outputFileTestInfo( $f ){
if ( ! file_exists( $f ) ){
print \"$f does not exist<BR>\";
return;
}
print \"$f was accessed on \".date( \"D d M Y g:i A\", fileatime( $f ) ).\"<br>\";
}
?>
filemtime
filemtime函数返回文件中的数据块上次被写入的时间,也就是说,文件的内容上次被修改的时间。
实例:
<?php
$file = \"test.txt\";
outputFileTestInfo( $file );
/* http://www.manongjc.com/article/1374.html */
function outputFileTestInfo( $f ){
if ( ! file_exists( $f ) ){
print \"$f does not exist<BR>\";
return;
}
print \"$f was modified on \".date( \"D d M Y g:i A\", filemtime( $f ) ).\"<br>\";
}
?>
filectime
filectime返回文件上次 inode 被修改的时间,即文件创建时间, 或者在失败时返回 FALSE 。 时间以 Unix 时间戳的方式返回。
<?php
$file = \"test.txt\";
outputFileTestInfo( $file );
function outputFileTestInfo( $f ){
if ( ! file_exists( $f ) ){
print \"$f does not exist<BR>\";
return;
}
print \"$f was changed on \".date( \"D d M Y g:i A\", filectime( $f ) ).\"<br>\";
}
?> 继续阅读与本文标签相同的文章
下一篇 :
php 判断文件是否可读可写可执行
-
详解Libra的Move IR编译器漏洞
2026-05-14栏目: 教程
-
人工智能时代的产业投资机会在哪里?交大行业研究院这场论坛有干货!
2026-05-14栏目: 教程
-
大数据的核心技术概念,你了解吗?
2026-05-14栏目: 教程
-
网红机器人泰坦现身大唐不夜城 能与观众聊天
2026-05-14栏目: 教程
-
罗永浩被指责带不动锤子手机 凌晨发文怼网友
2026-05-14栏目: 教程
