need help with sorting words by utf-8. For example, we have 5 cities from Belgium.
$array = array(\'Borgloon\',\'Thuin\',\'Lennik\',\'Éghezée\',\'Aubel\');
s
intl comes bundled with PHP from PHP 5.3 and it only supports UTF-8.
You can use a Collator in this case:
$array = array('Borgloon','Thuin','Lennik','Éghezée','Aubel');
$collator = new Collator('en_US');
$collator->sort($array);
print_r($array);
Output:
Array
(
[0] => Aubel
[1] => Borgloon
[2] => Éghezée
[3] => Lennik
[4] => Thuin
)