PHP通过asort()给关联数组按照值排序,和sort的区别是,sort是按照
/**
* PHP通过asort()给关联数组按照值排序
*
* @param
* @arrange 512-笔记网: jb51.cc
**/
$nums = array("one"=>5,"two"=>2,"three"=>1);
asort( $nums );
foreach ( $nums as $key => $val ) {
print "$key = $val<br />";
}
/*** 来自编程之家 jb51.cc(jb51.cc) ***/
原文链接:https://www.f2er.com/php/528442.html