欢迎光临
感谢一路有你

两个二维数组进行合并,输出全部数据

如果你对该文章中的内容有疑问/不解,可以点击此处链接提问
要注明问题和此文章链接地址 点击此处跳转
 
<?php
header("Content-type:text/html;charset=utf8");
$list=[

    0 => [
        'delivery_date' => '2018-01-17',
        'target_house'  =>'快消浦西仓',
        'sort_num'      =>104,
        'sort_type'     =>'整',
    ],
    1 =>[
        'null_sort_scatter_num'=>0,
        'allot_scatter_num' =>0,
        'other_statu_full_num'  =>0,
        'other_statu_scatter_num'   =>0
        ],

];
$list1=[
    0 => [
        'delivery_date' => '2018-01-17',
        'house'  =>'浦西仓',
        'sort_num'      =>104,
        'type'     =>'整',
    ],
    1 =>[
        'null_sort_scatter_num'=>0,
        'allot_scatter_num' =>0,
        'other'  =>0,
        'other_statu'   =>0
    ],
];

$arr = array();  
foreach($list as $k=>$v){  
    $arr[] = array_merge($v,$list1[$k]);  
}  
var_dump($arr);

输出结果

赞(8) 打赏
未经允许不得转载:王明昌博客 » 两个二维数组进行合并,输出全部数据
分享到: 更多 (0)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏