我有两个像这样的阵列
array (
[0] => Array
(
[search_terms] => Big Black Gay
[searches] => 1
)
[1] => Array
(
[search_terms] => Men Seeking Men Personals
[searches] => 1
)
)
Run Code Online (Sandbox Code Playgroud)
像这样的另一个阵列
array (
[0] => Array
(
[search_terms] => Men Seeking Men Personals
[clicks] => 1
)
)
Run Code Online (Sandbox Code Playgroud)
如何在不使用任何循环的情况下合并上面的两个数组?任何PHP功能都可用于此?我需要这种出局
Array
(
[0] => Array
(
[search_terms] => Big Black Gay
[searches] => 1
[clicks] => 0
)
[1] => Array
(
[search_terms] => Men Seeking Men Personals
[searches] => 1
[clicks] => 1
)
)
Run Code Online (Sandbox Code Playgroud)
看一下array_merge
var_dump(array_merge($array_one,$array_two));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
144 次 |
| 最近记录: |