#32823 [Opn->Bgs]: asort orders before uppercase words. a case-insensitive function is needed

From: Date: Mon, 25 Apr 2005 12:29:49 +0000
Subject: #32823 [Opn->Bgs]: asort orders before uppercase words. a case-insensitive function is needed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-78166@lists.php.net to get a copy of this message
ID: 32823 Updated by: sniper@php.net Reported By: asgl at email dot it -Status: Open +Status: Bogus -Bug Type: Unknown/Other Function +Bug Type: Arrays related Operating System: Windows XP Professional SP2 PHP Version: 5.0.4 New Comment: Something like natcasesort() perhaps? RTFM.. Previous Comments: ------------------------------------------------------------------------ [2005-04-25 13:59:44] asgl at email dot it Description: ------------ When I order an array with the asort() function, the words that begin with an uppercase letter are ordered before the others. I think a a case-insensitive would be useful. In fact, in the alphabet there isn't any difference between "A" and "a". Example: <?php $array = array("cat", "Dog", "Mice"); asort($array); print_r($array); ?> This returns: Array ( [1] => Dog [2] => Mice [0] => cat ) It must return, instead Array ( [0] => cat [1] => Dog [2] => Mice ) because "cat" < "Dog" < "Mice". PS: excuse me for my bad English :) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32823&edit=1

« previous php.bugs (#78166) next »