Add items from one array to another

Posted by Peterim on Stack Overflow See other posts from Stack Overflow or by Peterim
Published on 2010-06-07T16:30:13Z Indexed on 2010/06/07 16:32 UTC
Read the original article Hit count: 281

Filed under:
|

I have two arrays:

1) The first array:

array(

    [0] => array(
              [code] => code_1
              [value] => xxx
    [1] => array(
              [code] => code_2
              [value] => xxx     
    [2] => array(
              [code] => code_3
              [value] => xxx     

2) The second array:

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    

How can add two missing items (code_4 and code_5) from array2 to array1?

Thank you!

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays