php 二维数组排序

直接Demo:
$person = array(
  array('num'=>'001','id'=>6,'name'=>'zhangsan','age'=>21),
  array('num'=>'001','id'=>7,'name'=>'ahangsan','age'=>23),
  array('num'=>'003','id'=>1,'name'=>'bhangsan','age'=>23),
  array('num'=>'001','id'=>3,'name'=>'dhangsan','age'=>23),
);

//先把要排序的字段组合成一维数组
$ids= array();
foreach ($person as $user) {
  $ids[] = $user['id'];
}
array_multisort($ids, SORT_ASC, $person );    //排序
上一篇:fastadmin批量修改状态


下一篇:winServer 监控Serv-U服务脚本(停止自动启动)