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. 
  2. <?php $testfile = 'hello.txt';
  3. echo filesize($testfile);// this will echo in byte
  4.  
  5. //this next line are the mdifcation time, and its more than just number
  6. //filemtime: last modified (changed content). and its the file modifiaction time
  7. echo strftime('%m%d%Y %H:%M', filemtime($testfile)).'<br/?>';&#13;
  8. //filectime: last changed (changed content or metadata)or the last change time of the content of metadata&#13;
  9. echo

Add new comment