我想将这两个数组合并在一起
Array
(
[0] => Array
(
[type] => Person
[relevance] => 0.700000
[count] => 300
[text] => Chris
)
)
Array
(
[0] => Array
(
[type] => Person
[relevance] => 0.900000
[count] => 400
[text] => Chris
)
[1] => Array
(
[type] => Person
[relevance] => 0.500000
[count] => 200
[text] => Tom
)
)
所以我可能会有这样的结果
Array
(
[0] => Array
(
[type] => Person
[relevance] => 0.900000
[count] => 400
[text] => Chris
)
[1] => Array
(
[type] => Person
[relevance] => 0.500000
[count] => 200
[text] => Tom
)
[2] => Array
(
[type] => Person
[relevance] => 0.700000
[count] => 300
[text] => taye
)
)
答案 0 :(得分:1)
答案 1 :(得分:0)
尝试使用foreach
// $array1 is your original array
foreach($array2 as $val) {
array_push($array2,$val)
}
答案 2 :(得分:0)
使用array_merge docs并更快地检查文档:D
答案 3 :(得分:0)
您是否搜索过PHP Doc?