note 19908 modified in function.sort by derick
| From: | derick@php.net | Date: | Wed, 31 Aug 2005 10:38:17 +0000 |
| Subject: | note 19908 modified in function.sort by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-94495@lists.php.net to get a copy of this message | ||
If you want to sort an array according to your locale do the following:
(de_DE as example)
setlocale("LC_ALL","de_DE");
usort($arraytobesorted, 'strcoll');
--ed: In PHP 4.4 and PHP 5.0 you can do:
setlocale("LC_ALL", "de_DE");
sort($arraytobesorted, SORT_LOCALE_STRNG);
--was--
If you want to sort an array according to your locale do the following:
(de_DE as example)
setlocale("LC_ALL","de_DE");
usort($arraytobesorted, 'strcoll');
http://php.net/manual/en/function.sort.php