排序按字母顺序无法正常工作 [英] asort not working properly alphabetically
本文介绍了排序按字母顺序无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个如下数组。我正在尝试使用asort按字母顺序对数组进行排序。但不起作用
I have a array like below. I am trying to sort the array alphabetically with asort. but it does not work
Array
(
[0] => BelExpo exhibition center
[1] => Aurora cinema theatre
[2] => Yunost Ice hockey palace
[3] => Rakauski free market
[4] => Grushevka Metro Station
)
$arr = asort($arr1); // output gives 1
预先感谢
推荐答案
好的,我解决了这个问题。
OK great I solved the problem.
sort返回布尔值。无需将其放在变量中。只需按顺序传递数组即可。它将起作用
sort return boolean value. no need to put it in variable. just pass the array in sort. and it will work
sort($arr);
print_r($arr);
这篇关于排序按字母顺序无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文