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))
you'll have it.
Jim
- Original Message -
From: "Bob Irwin" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 3:03 PM
Subject: [PHP] Reading Directory in reverse
> Hi Guys,
>
> Does anyone happen to know why the below
Hi Guys,
Does anyone happen to know why the below code reads the directory in reverse
alphabetical order? Not a major problem - easy enough to whack it in an
array and sort it, but annoying nonetheless.
$default_dir = "../screenshots";
if (!($dp = opendir($default_dir))) die("cannot open $defa
3 matches
Mail list logo