PHP filectime() Function
Definition and Usage
The filectime() function returns the last inode modification time of the specified file.
This function returns the time when the last inode of the file was modified. If an error occurs, it returns false. The time is returned in the form of a Unix timestamp.
Syntax
fileatime(filename)
Parameter | Description |
---|---|
filename | Required. Specifies the file to be checked. |
Tips and Comments
Tip:The result of this function will be cached. Please use clearstatcache() to clear the cache.
Note:In most Unix file systems, a file is considered to be modified when the inode data of the file is changed. That is, when the file permissions, owner, group, or other metadata in the inode are updated. See filemtime()(This is the function you want to use to create a "Last Updated" footnote on web pages) and fileatime().
Note:Some Unix documentation text refers to ctime as the file creation time, which is incorrect. In most Unix file systems, there is no file creation time for Unix files.
Example
<?php echo filectime("test.txt"); echo "Last change: ".date("F d Y H:i:s.",filectime("test.txt")); ?>
Output:
1138609592 Last change: January 30 2006 09:26:32.