Re: Sort Question
| From: | Richard Lynch | Date: | Wed, 02 May 2001 07:54:36 +0000 |
| Subject: | Re: Sort Question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-51148@lists.php.net to get a copy of this message | ||
> I am doing a dir list of an ftp and using sort to sort the dir list
> alphabetically. What I am using now sorts it alphabetically but it sorts
> the capital letters then the lower case so a capital "Z" would come before
a
> lower case "a"
>
> The Code I am using is:
>
> sort($complete_list);
> return $complete_list;
>
> Does someone know how I can sort an array alphabetically with the case
> insensitive sort?
usort($complete_list, 'strcasecmp');
http://php.net/manual/en/function.usort.php
http://php.net/manual/en/function.strcasecmp.php
--
WARNING richard@zend.com address is not working -- Use ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm