Get a list of the file names using normal methods (glob(), scandir(), whatever), and store the filenames in an array. Then loop through that array using filemtime() and store that value against your array. Finally, sort the array by your stored filemtime() value
Yep, you need readdir() and filemtime().
Get a list of the file names using normal methods (glob(), scandir(), whatever), and store the filenames in an array. Then loop through that array using filemtime() and store that value against your array. Finally, sort the array by your stored filemtime() value
Alternatively, look at DirectoryIterator and Sorting files by creation/modification date in PHP