Hello, I have 2 array: $pids = array ( 40 => 0, 41 => 1, 43 => 2, 42 => 3 ); $ids = array( $pids , 678=>'', 444=>''); PHP: I want to join the two arrays. How do I get the following output in the second array: $result = array (40 => '', 41 => '', 43 =>'', 42 => '', 678=>'', 444=>''); Thank you!
<?php $array1 = array("color" => "red", 2, 4); $array2 = array("a", "b", "color" => "green", "shape" => "trapezoid", 4); $result = array_merge($array1, $array2); print_r($result); ?> Code (markup):