标签:blog io for ar div cti log new on
function array_sort($arr,$keys,$type=‘asc‘){ $keysvalue= $new_array= array(); foreach($arr as $k=>$v){ $keysvalue[$k] = $v[$keys]; } if($type== ‘asc‘){ asort($keysvalue); }else{ arsort($keysvalue); } reset($keysvalue); foreach($keysvalue as $k=>$v){ $new_array[$k] = $arr[$k]; } return $new_array; }
php 二维数组排序
标签:blog io for ar div cti log new on
原文地址:http://www.cnblogs.com/chenzhaojx/p/3939025.html