$my_array = array("a" => "Dog", "b" => "Cat", "c" => "Horse"); krsort($my_array); print_r($my_array); ?> 复制代码 输出: $my_array = array("a" => "Dog", "b" => "Cat", "c" => "Horse"); asort($my_array); print_r($my_array); ?> 复制代码 输出: Array ( => Cat [a] => Dog [c] => Horse ) >>> 更多内容,请查看 php数组排序方法大全