PHP fileatime() Function
Definition and Usage
The fileatime() function returns the last access time of the specified file.
This function returns the last access time of the file. If an error occurs, it returns false. The time is returned in the form of Unix timestamp.
Syntax
fileatime(filename)
Parameter | Description |
---|---|
filename | Required. Specify 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:The atime of the file should be changed whenever the data block in the file is read. When an application regularly accesses a large number of files or directories, it can greatly affect performance. Some Unix file systems can turn off atime updates when loading to improve the performance of such programs. USENET news group offline is a common example. Under this file system, this function is not useful.
Example
<?php echo fileatime("test.txt"); echo "Last access: ".date("F d Y H:i:s.",fileatime("test.txt")); ?>
Output:
1140684501 Last access: February 23 2006 09:48:21.