php使用array_column将二维数组key替换成指定的key值最简单的方法 2022-06-15

$data_list = [
    0 => [
        ["id"] => 876,
        ["get_commission"] => NULL,
        ["wait_commission"] => "174.00",
        ["tuition_sum"] => "5800.00",
        ["wait_pay"] => "5000.00",
    ],
    1 =>[
        ["id"] => 875,
        ["get_commission"] => NULL,
        ["wait_commission"] => "30.00",
        ["tuition_sum"] => "1000.00",
        ["wait_pay"] => NULL
    ],
    2 => [
        ["id"] => 873,
        ["get_commission"] => NULL,
        ["wait_commission"] => "210.00",
        ["tuition_sum"] => "2000.00",
        ["wait_pay"] => NULL
    ],
];
$data_list = array_column($data_list, NULL, 'id');
dump($data_list);

image.png

转载:(16条消息) php使用array_column将二维数组key替换成指定的key值最简单的方法_向宇it的博客-CSDN博客_php 数组key替换

你可能感兴趣的:(php使用array_column将二维数组key替换成指定的key值最简单的方法 2022-06-15)