美文网首页
php使用array_column将二维数组key替换成指定的k

php使用array_column将二维数组key替换成指定的k

作者: 阿然学编程 | 来源:发表于2022-06-14 16:50 被阅读0次
    $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替换成指定的k

          本文链接:https://www.haomeiwen.com/subject/bvmxvrtx.html