You can use the stat()
function in PHP to get the last accessed time of a file. Here's an example:
main.php221 chars7 lines
This will display the last accessed time of the file in a human-readable format. You can also use the fileatime()
function, which is a shortcut for calling stat()
and returning just the last accessed time:
main.php144 chars5 lines
Both of these methods will give you the last accessed time of a file in PHP. If you need to get the last modification time, you can use filemtime()
or retrieve the 'mtime'
value from the stat()
function.
gistlibby LogSnag