The fileatime() function returns the last access time of the specified file.
If successful, the function returns the last access time of the file as a Unix timestamp. If it fails, returns FALSE.
fileatime(filename)
parameter | describe |
---|---|
filename | Required. Specifies the documents to be checked. |
Note: The results of this function will be cached. Please use clearstatcache() to clear the cache.
Note: The access time of a file should be changed whenever a block of data in the file is read. Some Unix systems turn off access time updates. This is because when an application regularly accesses a large number of files, it affects performance. Turning off access time updates can improve the performance of such programs. The USENET newsgroup spool is a common example. In this file system, this function is useless.
<?phpecho fileatime("test.txt");echo "<br />";echo "Last access: ".date("F d YH:i:s.",fileatime("test.txt")); ?>
The above code will output:
1140684501Last access: February 23 2006 09:48:21.