How can the modification date of a directory be accessed in PHP using the filemtime function?

To access the modification date of a directory in PHP using the filemtime function, you need to provide the path to the directory as an argument to the function. This will return the timestamp of the last modification of the directory. You can then use the date function to format the timestamp into a human-readable date format.

$directory = '/path/to/directory';
$modification_date = filemtime($directory);
$formatted_date = date("Y-m-d H:i:s", $modification_date);
echo "Last modified date of directory: " . $formatted_date;