多维数字排序

 

$data=array(
  0=>array('one'=>34,'two'=>'d'),
  1=>array('one'=>45,'two'=>'e'),
  2=>array('one'=>47,'two'=>'h'),
  3=>array('one'=>12,'two'=>'c'),
  4=>array('one'=>15,'two'=>'w'),
  5=>array('one'=>85,'two'=>'r'),
);
foreach($data as $val){
  $key_arrays[]=$val['one'];
}
array_multisort($key_arrays,SORT_DESC,SORT_NUMERIC,$data);
var_dump($data);

posted @   刹那风华——  阅读(144)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示