$one = [
'one' => [
'height' => 175 ,
'weight' => 50
]
];
$two = [
'two' => [
'height' => 172 ,
'weight' => 60
]
];
$three = [
'three' => [
'height' => 172,
'weight' => 50
],
'four'=>[
'height' => 173,
'weight' => 50
]
];
$all = array_merge( $one , $two ,$three);
// 取得列的列表
foreach ($all as $key => $row) {
$weight[$key] = $row['weight'];
$height[$key] = $row['height'];
}
//var_dump($weight);exit;
array_multisort( $height , SORT_ASC , $weight ,SORT_DESC ,$all );
print_r($all);
php-根据身高排序,在根据重量排序
最新推荐文章于 2024-07-15 17:01:18 发布