Sort locale problem
| From: | Johan Gr�nvall | Date: | Sun, 15 Jun 2003 03:25:11 +0000 |
| Subject: | Sort locale problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-151537@lists.php.net to get a copy of this message | ||
Hi!
I'm trying to sort an array with strings containing swedish characters.
However, the sort order is wrong.
The following code produces "abäåö" while it should be "abåäö".
$list = array("ö", "ä", "a","å","b");
setlocale("LC_ALL","se_SE.ISO8859-1");
usort($list, 'strcoll');
for($i=0;$i<count($list);$i++) {
echo $list[$i];
}
Any ideas? Running Apache/2.0.43 PHP/4.2.3 Linux 2.4.18
/Johan