10 – PHP File Handling: Examining File Details

0
830

In this tutrial, 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:

 

When executing the code above, it will return the size of a file in bytes and all the modification time are all the same. And it looks like as shown below.

 Output:

 13
01/09/2014 14:37
01/03/2014 02:53
01/09/2014 14:37

Next, on that we can modify those time is using the touch command, so that we can update those into the current time and we can also pass in  some additional arguments. But this were going to set it to the current system time and flip all of these time to the current time. and here’s the following code.

 

Output:

 16
01/09/2014 14:37
01/03/2014 02:53
01/09/2014 14:37
01/09/2014 14:37
01/03/2014 02:53
01/09/2014 14:37
C:\xampp\htdocs\file
file_detail.php
file_detail
php
Facebook Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.