To get the last accessed date of a directory in PHP, you can use the fileatime()
function. This function returns the last accessed time of a file or directory, in Unix timestamp format (number of seconds since January 1 1970 00:00:00 UTC).
Here's an example code snippet that demonstrates how to use fileatime()
to get the last accessed date of a directory in PHP:
main.php346 chars11 lines
In this code, replace /path/to/your/directory
with the actual path to your directory. The date()
function is used to convert the Unix timestamp to a human-readable date/time string.
gistlibby LogSnag