sorts function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
matteo
Forum Newbie
Posts: 1
Joined: Fri Jun 13, 2003 9:03 am

sorts function

Post by matteo »

When I use sorts functions seems not to work with ucase letter. For example:

Frank
william
bibo

sort function result are:
bibo
william
Frank

and not like i would:
bibo
Frank
william
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

It is doing an ASCII sort where uppercase appear in the character set first, you will probably want to do a case-insensitive search.
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

The function natcasesort() should do the trick :D

http://php.net/manual/en/function.natcasesort.php
Post Reply