/ Published in: PHP
URL: http://www.jonasjohn.de/snippets/php/listdir-by-date.htm
Loads the contens of a dir an sorts them by the date of creation.
Expand |
Embed | Plain Text
function listdir_by_date($path){ if ($file != '.' and $file != '..'){ // add the filename, to be sure not to // overwrite a array key $list[$ctime] = $file; } } return $list; }
Comments
Subscribe to comments
You need to login to post a comment.

I noticed a problem on line 8. You wrote: $ctime = filectime($data_path . $file) . ',' . $file;
but I guess it have to be: $ctime = filectime($path . $file) . ',' . $file;
Am I wrong? Thank you for sharing