PHP中可以显示文件的各种属性,这些属性包括文件的最后访问时间、最后修改时间、文件大小等。
/**
* PHP获得文件大小和文件创建时间
*
* @param
* @arrange 512-笔记网: www.jb51.cc
**/
print "The size of the file is ";
print filesize( "samplefile.doc" );
print "<br>";
$atime = fileatime( "samplefile.doc" );
print "This file accessed on ";
print date("l,M d,Y g:i a",$atime);
print "<br>";
$mtime = filemtime( "samplefile.doc" );
print "This file was modified on ";
print date("l,$mtime);
print "<br>";
$ctime = filectime( "samplefile.doc" );
print "This file was changed on ";
print date("l,$ctime);
/*** 来自编程之家 jb51.cc(jb51.cc) ***/
原文链接:https://www.f2er.com/php/528335.html