php合并数组并按某个键值大小排序

合并两个数组,按年龄降序排列

//合并Arr1和Arr2,并按年龄ege降序排列
$Arr1[0] = array("name"=>"张三","ege"=>"30");
$Arr1[1] = array("name"=>"李四","ege"=>"20");
$Arr2[0] = array("name"=>"王五","ege"=>"18");
$Arr2[1] = array("name"=>"赵六","ege"=>"40");
$M_Arr = array_merge($Arr1,$Arr2);
$temps = array_column($M_Arr, 'ege');
array_multisort($temps,SORT_DESC,$M_Arr);
print_r($M_Arr);
Array
(
    [0] => Array
        (
            [name] => 赵六
            [ege] => 40
        )

    [1] => Array
        (
            [name] => 张三
            [ege] => 30
        )

    [2] => Array
        (
            [name] => 李四
            [ege] => 20
        )

    [3] => Array
        (
            [name] => 王五
            [ege] => 18
        )

)