Various time for php to read files. In php, you can use the filemtime () function to obtain the file modification time. it can return the last modification time of the file content. If the modification succeeds, the Unix timestamp-based party needs to get the modification of the file in php. we can directly use the filemtime () function to return the last modification time of the file content.
If successful, the time is returned in Unix timestamp format. If it fails, false is returned.
Filemtime (string filename)
Returns the time when the file was last modified. If an error occurs, FALSE is returned. Time is returned in Unix timestamp format and can be used for date ().
The code is as follows: |
|
$ A = filemtime ("log.txt "); Echo "Modification time:". date ("Y-m-d H: I: s", $ ); |
Filectime (string filename)
Returns the time when the last inode of the file was modified. If an error occurs, FALSE is returned. Time is returned in Unix timestamp format.
The code is as follows: |
|
$ A = filectime ("log.txt "); Echo "creation time:". date ("Y-m-d H: I: s", $ ); |
Fileatime (string filename)
Returns the time when the object was last accessed. If an error occurs, FALSE is returned. Time is returned in Unix timestamp format.
The code is as follows: |
|
$ A = fileatime ("log.txt "); Echo "Modification time:". date ("Y-m-d H: I: s", $ )." |
Returns the last modification time of the object content. If it succeeds, the time is Unix timestamp...