PHP fileatime() Function

PHP fileatime Function


Definition :

The PHP fileatime() function returns the last access time of the specified file.

Note: The results of this function are cached. Use clearstatcache() function to clear the cache.

Note: The atime of a file is supposed to change whenever the data blocks of a file are being read. This can decrease the performance if an application accesses a large number of files or directories. Some Unix systems have access time updates disabled to increase performance. On such filesystems this function will be useless.

Syntax

   fileatime(filename)

Parameter
Parameter Description
filename Required. Specifies the path to the file to check

Given below example Get last access time of "demo.txt":

Output : 1642158280
               Last access: January 14 2022 12:04:40.