doc似乎没有告诉我们用于数组排序的算法。那么函数arsort使用什么算法?换句话说,它是否使用合并排序,快速排序?
代码取自doc:
<?php
$fruits = array("d" => "lemon", "a" => "orange", "b" => "banana", "c" => "apple");
arsort($fruits);
foreach ($fruits as $key => $val) {
echo "$key = $val\n";
}
输出:
a = orange
d = lemon
b = banana
c = apple
答案 0 :(得分:3)