php根据二维数组的某一项对数组进行排序
<?php $data = array( array( ‘id‘ => 5698, ‘first_name‘ => ‘Bill‘, ‘last_name‘ => ‘Gates‘, ), array( ‘id‘ => 4767, ‘first_name‘ => ‘Steve‘, ‘last_name‘ => ‘Aobs‘, ), array( ‘id‘ => 3809, ‘first_name‘ => ‘Mark‘, ‘last_name‘ => ‘Zuckerberg‘, ) ); //根据字段last_name对数组$data进行降序排列 $last_names = array_column($data,‘last_name‘); array_multisort($last_names,SORT_DESC,$data); var_dump($data); ?>
相关推荐
sasac 2020-09-25
huangjie0 2020-09-25
cloudking000 2020-09-11
xiaoxiaokeke 2020-07-28
mingyunxiaohai 2020-07-28
honghao0 2020-07-27
风吹夏天 2020-07-26
夕加加 2020-07-20
CallmeZhe 2020-06-29
zhoujiyu 2020-06-28
清风徐来水波不兴 2020-06-16
Happyunlimited 2020-06-15
wanff0 2020-06-14
cuiguanjun 2020-06-13
啸林 2020-06-12
jiayuqicz 2020-06-09
章鱼之家 2020-06-08
guangmingsky 2020-06-05