我必须使用比较函数按字母顺序排列字符串数组。
必须不区分大小写和重音。
最好的例子是:PR is higher than pô
不错的内置解决方案
警告:必须安装PHP5模块
$collator = new Collator('fr_FR');
$newIsHigher = $collator->compare($new, $base) == 1;
当你想排序Unicode字符串时,你必须执行一个叫做collation的操作。
有一个PHP类叫做Collator
,它做这个
这可能是你需要的:
sort($array, SORT_LOCALE_STRING | SORT_FLAG_CASE);