限时免费试用:欢迎注册 api.bigmodel.org ,快速体验大模型 API 接入服务。
当前位置:首页 >疑难片段

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

分类:疑难片段时间:2018-05-30浏览:9836
 [
        '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);
输出结果
本站文章如未注明出处均为原创,转载请注明出处,如有侵权请邮件联系站长。
0/500
Share your thoughts respectfully.