array("cat"), "wilds"=>array("wolf", "fox")); $array2 = array("pets"=>array("dog", "horse"), "wilds"=>array("tiger")); $array3 = array("pets"=>array("rabbit"), "wilds"=>array("lion")); // Performing array replacement recursively $result = array_replace_recursive($array1, $array2, $array3); print_r($result); ?>