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). Link to comment https://forums.phpfreaks.com/topic/222242-counting-files/ 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 Link to comment https://forums.phpfreaks.com/topic/222242-counting-files/#findComment-1149649 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. Link to comment https://forums.phpfreaks.com/topic/222242-counting-files/#findComment-1149759 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.