From: asgl at email dot it
Operating system: Windows XP Professional SP2
PHP version: 5.0.4
PHP Bug Type: Unknown/Other Function
Bug description: asort orders before uppercase words. a case-insensitive
function is needed
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 bug report at http://bugs.php.net/?id=32823&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32823&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32823&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32823&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32823&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32823&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32823&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32823&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32823&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32823&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32823&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32823&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32823&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32823&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32823&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32823&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32823&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32823&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32823&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32823&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32823&r=mysqlcfg