php中asort()函数怎么用 php usort函数

主机教程 建站分享 2年前 (2022-11-20) 220次浏览

文章摘要:php中asort()函数怎么用 php usort函数

asort()函数作用: php中asort()函数的作用是对关联数组按照键值进行升序排序。 asort()函 […]

asort()函数作用:

php中asort()函数的作用是对关联数组按照键值进行升序排序。

asort()函数语法:

asort(array,sortingtype);

参数:

array:表示需要进行排序的数组。

sortingtype:表示规定排列数组的元素。

asort()函数使用方法:

例:将关联数组按照键值进行升序排序

$age=array("Bill"=>"60","Steve"=>"56","Mark"=>"31");

asort($age);

?>


声明:
若非注明,本站文章源于互联网收集整理和网友分享发布,如有侵权,请联系站长处理。
文章名称:php中asort()函数怎么用 php usort函数
文章链接:http://www.7966.org/post/12913.html
转载请注明出处

喜欢 (0)