欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php获得文件大小和文件创建时间

程序员文章站 2024-01-05 09:30:52
...

php中可以显示文件的各种属性,这些属性包括文件的最后访问时间、最后修改时间、文件大小等。

  1. Returning information about a file
  2. print "The size of the file is ";
  3. print filesize( "samplefile.doc" );
  4. print "
    ";
  5. $atime = fileatime( "samplefile.doc" );
  6. print "This file accessed on ";
  7. print date("l, M d, Y g:i a", $atime);
  8. print "
    ";
  9. $mtime = filemtime( "samplefile.doc" );
  10. print "This file was modified on ";
  11. print date("l, M d, Y g:i a", $mtime);
  12. print "
    ";
  13. $ctime = filectime( "samplefile.doc" );
  14. print "This file was changed on ";
  15. print date("l, M d, Y g:i a", $ctime);
  16. ?>
复制代码

php

上一篇:

下一篇: