fileatime
Gets last access time of file
Syntax
fileatime ( string $filename ) : int
Parameters
filename
Path to the file.
Return
Returns the time the file was last accessed, or FALSE on failure. The time is returned as a Unix timestamp.
Examples
1
<? $filename = $_SERVER["DOCUMENT_ROOT"] . "/assets/txt/file.txt"; $return = fileatime($filename); echo $return; ?>
1619162626
2
<? $filename = $_SERVER["DOCUMENT_ROOT"] . "/assets/txt/file.txt"; $return = fileatime($filename); echo "last accessed: " . date("Y-m-d H:i:s", $return); ?>
last accessed: 2021-04-23 07:23:46