i'm trying to print a sorted list of filenames by doing:
$map = scandir('../download/'.$username.'/');
but when i print it, the sorting is divided in to two groups, here is the output:
--------------
.
..
3420.jpg
Biker-Mice From Mars # SNES.SMC
DXSETUP.exe
Getting Started.[1].pdf
Getting Started.[2].pdf
Getting Started.pdf
SCPH1001.BIN
VLC.lnk
a2_commands.txt // group two starts here
artifacts.xml
dps.sub
dxupdate.cab
extra3.jpg
main.[1].css
main.css
put_memcards_here.txt
--------------------------
i was hoping they would be sorted as one group. any ideas why this is happening?
sort() help
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: sort() help
It's the difference in the case of the character. The ASCII codes for lowercase characters are higher than uppercase characters. Try natcasesort().
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: sort() help
Thanks, i would never have noticed that 
AbraCadaver wrote:It's the difference in the case of the character. The ASCII codes for lowercase characters are higher than uppercase characters. Try natcasesort().