I recall wanting to do this and didn't find a very good solution, but I was able to end up with something close. I use this method for my wife's website on a page where we share some of the latest pictures at home, with the family, etc. What I did was scan the folder in question and then get the filemtime() of the file and sort the array based on that.













Hey Guys (gals),
I would like to create a PHP function that reads x amount of files from a directory, but I would like those files sorted by the date they were added to the directory. I know that the directory keeps this type of meta information, but I'm not sure how to access it using PHP. I've done a couple quick google searches but haven't found anything.
Can anyone help me out?
I'm Not Allowed On The Couch