Miles LLC Posted December 20, 2010 Share Posted December 20, 2010 I know how to count the files: <?php $dir = $_SERVER[DOCUMENT_ROOT]."/api/sigs/cache/".$i[id]."/"; $files = scandir($dir); $result = count($files); printf("$result Signatures Generated"); ?> But i'm trying to make it so it only counts the files that were modified recently (That Day). Quote Link to comment Share on other sites More sharing options...
The Letter E Posted December 20, 2010 Share Posted December 20, 2010 I know how to count the files: <?php $dir = $_SERVER[DOCUMENT_ROOT]."/api/sigs/cache/".$i[id]."/"; $files = scandir($dir); $result = count($files); printf("$result Signatures Generated"); ?> But i'm trying to make it so it only counts the files that were modified recently (That Day). Try reading up here: http://php.net/manual/en/function.filemtime.php Quote Link to comment Share on other sites More sharing options...
bibby Posted December 21, 2010 Share Posted December 21, 2010 scandir will also have the "files" '.' (here) and '..' (parent directory), be sure to filter those out. The directory will more than likely see its modified time updated when one of its files does. I like is_file for as well, because file_exists() on a directory will be TRUE. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.