标签:index code print array multi 键值 数组 bsp int
$arr=[ array( ‘name‘=>‘小坏龙‘, ‘age‘=>28 ), array( ‘name‘=>‘小坏龙2‘, ‘age‘=>14 ), array( ‘name‘=>‘小坏龙3‘, ‘age‘=>59 ), array( ‘name‘=>‘小坏龙4‘, ‘age‘=>23 ), array( ‘name‘=>‘小坏龙5‘, ‘age‘=>23 ), array( ‘name‘=>‘小坏龙6‘, ‘age‘=>21 ), ];
array_multisort
(array_column(
$arr
,
‘age‘
),SORT_DESC,
$arr
);
print_r(
$arr
);
array_multisort(数组(一维数组),排序方式(SOTR_ASC,SOTR_DESC),其他数组(可以是二维的))
标签:index code print array multi 键值 数组 bsp int
原文地址:http://www.cnblogs.com/shione/p/7648218.html