Right now I have a code snippet that opens a given directory and finds the three most recently modified files in that directory. IS there any way to modifiy it so that it checks all of the SUBDIRECTORIES of the original directory for the three most recently modified images?
chdir ($dir);
$handle = opendir(".");
$c = 0;
$date = array();
$files = array();
while ($file = readdir ($handle))
{
if ($file != "." && $file != ".." && $file != "index.php" && $file != "index2.php")
{
$date[$c] = filemtime ($file);
$files[$date[$c]] = $file;
$c++;
}
}
rewinddir ($handle);
closedir ($handle);
rsort ($date);