php krsort 函数
krsort ( PHP 4中, PHP 5中)
krsort -排序的数组的关键顺序相反
描述
布尔krsort (阵列& $阵列[摘要$ sort_flags = SORT_REGULAR ] )
各种各样的一系列重要的次序颠倒,保持关键数据的相关性。这是非常有用的主要是关联数组。
参数
阵列
输入数组。
sort_flags
你可以修改的行为排序使用可选参数sort_flags ,详情见排序()。
返回值
返回TRUE或FALSE的成功失败。
实例
例如# 1 krsort()的例子
<?php $fruits = array("d"=>"lemon", "a"=>"orange", "b"=>"banana", "c"=>"apple"); krsort($fruits); foreach ($fruits as $key => $val) { echo "$key = $valn"; } ?>
The above example will output:
d = lemon c = apple b = banana a = orange
永久地址:http://www.phprm.com/function/d9738c3d8487c41086e8543e1421149d.html
转载随意~请带上教程地址吧^^