You can use scandir to return the names of all the files in the directory:
PHP: scandir - Manual
and then for each file you can get the last modified date and time using filemtime:
PHP: filemtime - Manual
Put the filenames in one array and the modified dates and times in a second array. Sort the modified times using asort:
PHP: asort - Manual which keeps the indexes in the original order (or use arsort if you want them in reverse order). Then step through the sorted modified times array, pulling out the keys and use the keys to access the filenames array. The filenames will then be accessed in DTM order.