note 66248 added to function.array-multisort
| From: | CesarSirvent at osu1 dot php dot net | Date: | Wed, 17 May 2006 16:43:35 +0000 |
| Subject: | note 66248 added to function.array-multisort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-111516@lists.php.net to get a copy of this message | ||
There is a problem with array_multisort in languages other than English.
For special chars, as A with accent (Ã), the sorting does not correspond to what might expect
from a MySQL SELECT with ORDER BY.
For example
<?php
foreach ($students as $key => $row){
$surname[$key] = $row['surname'];
}
array_multisort($surname, SORT_ASC, $students);
?>
will sort the array in this way: ABADIA, ALVAREZ, BUÃUEL, ZUBIETA, ÃLVARES
while a MySQL SELECT with ORDER BY nombre ASC will yield
ABADIA, ÃLVARES, ALVEREZ, BUÃUEL, ZUBIETA
as A and à are considered two different representations of the same letter.
----
Server IP: 130.206.1.5
Probable Submitter: 80.34.87.62
----
X-Spam-Status: Yes, hits=8.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HEAD_ILLEGAL_CHARS,UPPERCASE_25_50 autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.array-multisort.php
Edit -- http://master.php.net/note/edit/66248
Del: integrated -- http://master.php.net/note/delete/66248/integrated
Del: useless -- http://master.php.net/note/delete/66248/useless
Del: bad code -- http://master.php.net/note/delete/66248/bad+code
Del: spam -- http://master.php.net/note/delete/66248/spam
Del: non-english -- http://master.php.net/note/delete/66248/non-english
Del: in docs -- http://master.php.net/note/delete/66248/in+docs
Del: other reasons-- http://master.php.net/note/delete/66248
Reject -- http://master.php.net/note/reject/66248
Search -- http://master.php.net/manage/user-notes.php