This article describes how to obtain the file size and file creation time in php. it involves the use of filesize and fileatime functions in php and has some reference value, for more information about how to obtain the file size and creation time in php, see the following example. Share it with you for your reference. The specific analysis is as follows:
Various attributes of the file can be displayed in php, including the last access time, last modification time, and file size.
Returning information about a file<? Phpprint "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 ", $ mtime); print"
"; $ Ctime = filectime (" samplefile.doc "); print" This file was changed on "; print date (" l, M d, Y g: I ", $ ctime);?>
I hope this article will help you with php programming.