array("a"=>"apple"), 5); $array2 = array(10, "fruits"=>array("a"=>"apricot", "banana")); // Merging the two arrays $result = array_merge_recursive($array1, $array2); print_r($result); ?>