PHP fileatime() Function
Complete PHP Filesystem Reference Manual
Definition and Usage
The fileatime() function returns the last access time of a specified file.
Returns the last access time of the file as a Unix timestamp on success, or FALSE on failure.
Syntax
fileatime(filename)
| Parameters | Description |
|---|---|
| filename | Required. Specifies the file to check. |
Tips and Notes
**Note:** The results of this function are cached. Use clearstatcache() to clear the cache.
**Note:** A file's access time should be changed whenever the data blocks in the file are read. Some Unix systems disable access time updates because they significantly hurt performance when an application regularly accesses a large number of files; disabling them improves the performance of such programs. USENET news spools are a common example. On such filesystems this function is of no use.
Example
"; echo "Last access: ".date("F d Y H:i:s.",fileatime("test.txt")); ?>The code above will output:
1140684501
Last access: February 23 2006 09:48:21.
Complete PHP Filesystem Reference Manual