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);