php 读取文件的各种时间
若成功,则时间以 Unix 时间戳的方式返回。若失败,则返回 false。
filemtime ( string filename )
返回文件上次被修改的时间,出错时返回 FALSE。时间以 Unix 时间戳的方式返回,可用于 date()。
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy4595')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy4595>$a=filemtime("log.txt");
echo "修改时间:".date("Y-m-d H:i:s",$a);
filectime ( string filename )
返回文件上次 inode 被修改的时间,如果出错则返回 FALSE。时间以 Unix 时间戳的方式返回。
$a=filectime("log.txt");
echo "创建时间:".date("Y-m-d H:i:s",$a);
fileatime ( string filename )
返回文件上次被访问的时间,如果出错则返回 FALSE。时间以 Unix 时间戳的方式返回。
<span><table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy8645')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy8645><span>
$a=fileatime("log.txt");
echo "修改时间:".date("Y-m-d H:i:s",$a)."
</span></span>您可能感兴趣的文章:
学习php读取文件内容的方法
PHP fread 读取文件
PHP按行读取文件时如何删除换行符
php读取远程文件的三种方法分享
php 读取文件的各种时间
二种php生成html页面实现代码
用PHP实现一个简易版文件上传功能(超详细讲解)
php 不同服务器共享session问题
PHP读文件乱码问题的解决方法
php 文件系统处理 fopen