标签: php
我有两个具有相同键名的数组,有时值可能相同。我想将这两个数组附加到一个新数组中。我添加了这些阵列的屏幕截图。我找到了array_merge,但我看到它覆盖而不是追加。在php中是否有任何功能可以执行此操作,或者我已经编写了自定义功能。
答案 0 :(得分:5)
尝试使用
array_merge_recursive($array1, $array2);