我有兩個陣列:從一個陣列將項目添加到另一個
1)第一陣列:
array(
[0] => array(
[code] => code_1
[value] => xxx
[1] => array(
[code] => code_2
[value] => xxx
[2] => array(
[code] => code_3
[value] => xxx
2)第二個數組:
array(
[0] => array(
[settingcode] => code_1
[value] => xxx
[1] => array(
[settingcode] => code_2
[value] => xxx
[2] => array(
[settingcode] => code_3
[value] => xxx
[3] => array(
[settingcode] => code_4
[value] => xxx
[4] => array(
[settingcode] => code_5
[value] => xxx
如何可以添加兩個缺少從array2到array1的項目(code_4
和code_5
)?
謝謝!
UPD。
對不起,我需要澄清一下這個問題。我需要的結果數組的樣子:
array(
[0] => array(
[code] => code_1
[value] => xxx
[1] => array(
[code] => code_2
[value] => xxx
[2] => array(
[code] => code_3
[value] => xxx
[3] => array(
[code] => code_4
[value] => xxx
[4] => array(
[code] => code_5
[value] => xxx