php获得文件大小和文件创建时间的方法_PHP

WBOY
Release: 2016-05-31 13:13:18
Original
907 people have browsed it

本文实例讲述了php获得文件大小和文件创建时间的方法。分享给大家供大家参考。具体分析如下:

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

  Returning information about a file 
  <?php print "The size of the file is "; print filesize( "samplefile.doc" ); print "
"; $atime = fileatime( "samplefile.doc" ); print "This file accessed on "; print date("l, M d, Y g:i a", $atime); print "
"; $mtime = filemtime( "samplefile.doc" ); print "This file was modified on "; print date("l, M d, Y g:i a", $mtime); print "
"; $ctime = filectime( "samplefile.doc" ); print "This file was changed on "; print date("l, M d, Y g:i a", $ctime); ?>
Copy after login

希望本文所述对大家的php程序设计有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!