欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

php如何实现两个数组合并

程序员文章站 2024-02-08 19:29:04
...
php怎么实现两个数组合并
数组一:
$a_array = Array
(
[0] => Array
(
[plan_id] => 1
[ad_img_url] => http://www.adsload.com/assets/ad1.jpg
)

[1] => Array
(
[plan_id] => 2
[ad_img_url] => http://www.adsload.com/assets/ad2.jpg
)

[2] => Array
(
[plan_id] => 3
[ad_img_url] => http://www.adsload.com/assets/ad3.jpg
)

)
数组二:
$b_array = Array
(
[0] => Array
(
[plan_id] => 1
[ad_url] => http://www.baidu.com/
)

[1] => Array
(
[plan_id] => 2
[ad_url] => http://www.baidu.com/
)

[2] => Array
(
[plan_id] => 3
[ad_url] => http://www.baidu.com/
)

)
合并后:
$ressult_array = Array
(
[0] => Array
(
[plan_id] => 1
[ad_img_url] => http://www.adsload.com/assets/ad1.jpg
[ad_url] => http://www.baidu.com/
)

[1] => Array
(
[plan_id] => 2
[ad_img_url] => http://www.adsload.com/assets/ad2.jpg
[ad_url] => http://www.baidu.com/
)

[2] => Array
(
[plan_id] => 3
[ad_img_url] => http://www.adsload.com/assets/ad3.jpg
[ad_url] => http://www.baidu.com/
php如何实现两个数组合并

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频