Read last modification time for a given directory

cabrera48 used Ask the Experts™
Is it possible to read the last modification for a given directory using PHP? Last modification meaning the last time a file changed or a file was added or deleted inside a given directory. Please let me know, thanks.

Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
$last_mod_time = filemtime("/path/dir/.");

you need the dot at the end to read the directoy as a file

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial