when I try the php array_merge functions the arrays seem to be overwriting each other. Here are two of the example arrays: Array ( [1] => Array ( [Product] => Array ( [detail_url] => product32.php ) ) [2] => Array ( [Product] => Array ( [detail_url] => product12.php ) ) ) Code (markup): and Array ( [1] => Array ( [Product] => Array ( [name] => Product 41 ) ) [2] => Array ( [Product] => Array ( [name] => Product 45 ) ) ) Code (markup): it need to read -> Array ( [1] => Array ( [Product] => Array ( [detail_url] => product32.php [name] => Product 41 ) ) [2] => Array ( [Product] => Array ( [detail_url] => product12.php [name] => Product 45 ) ) ) Code (markup): does anyone know how to combine these two arrays?
You could do it with a loop: $i = 1; foreach ($Array1 as $val) { $Array3($i,1) = $Array1($i); $Array3($i,2) = $Array2($i); $i = $i + 1; } //Array3 is then the final array PHP: unless thats an array within an array, then it needs a little altering