I’m looping through a directory and getting all the files using glob(). Is there a way to order the elements of the resulting array by the date/time they were created? Currently I’m using filemtime(), but that assumes that they were never edited.
Cheers!
You could try the following:
That passes an anonymous function to allow user-defined sorting of an array. The function this time, checks and sorts depending upon the creation time (windows) / inode change time(linux) of the files returned by glob.
Hope this helps.
ise