Re: [PHP] Reading Directory in reverse

2003-01-23 Thread Marek Kilimajer
It does not read it in reverse alphabetical order, but in the order it is listed on the filesystem, which happens to be in reverse alphabetical order. If you need it ordered, use $files=array(); if (!($dp = opendir($default_dir))) die("cannot open $default_dir"); while($file = readdir($dp))

Re: [PHP] Reading Directory in reverse

2003-01-22 Thread Jim Lucas
is it on a unix system? if so, do an ls on the system and you will see that the files are listed in that order. it is the order in which they were copied to the directory. try going through a loop before you run your main loop, create an array() then sort that with some sorting functions and you