Various attributes of files can be displayed in php, including the last access time, last modification time, file size, etc. of the file.
- Returning information about a file
- 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 code
|