Skip to main content

PHP File Handling: Examining File Details

Body
In this tutorial, I’m going to show how to get information about the file details. To start in this lesson lets create a new PHP file called “file_detail.php”. And add the following code:
  1. <?php $testfile = 'hello.txt';
  2. echo filesize($testfile);// this will echo in byte
  3.  
  4. //this next line are the mdifcation time, and its more than just number
  5. //filemtime: last modified (changed content). and its the file modifiaction time
  6. echo strftime('%m%d%Y %H:%M', filemtime($testfile)).'<br/?>';&#13;
  7. //filectime: last changed (changed content or metadata)or the last change time of the content of metadata&#13;
  8. echo

Add new comment