1, "b" => 2]; $associativeArray2 = ["c" => 3, "d" => 4]; $mergedAssociative = array_merge($associativeArray1, $associativeArray2); echo " Merged Associative Array: "; print_r($mergedAssociative); // Merging associative arrays with duplicate keys (latter overwrites former) $arrayWithDuplicateKeys1 = ["key1" => "value1", "key2" => "value2"]; $arrayWithDuplicateKeys2 = ["key2" => "new_value2", "key3" => "value3"]; $mergedWithOverwrite = array_merge($arrayWithDuplicateKeys1, $arrayWithDuplicateKeys2); echo " Merged with Duplicate Keys (Overwrite): "; print_r($mergedWithOverwrite); // Combining two arrays into an associative array (first as keys, second as values) $keys = ["name", "age", "city"]; $values = ["Alice", 30, "New York"]; $combinedArray = array_combine($keys, $values); echo " Combined Array (Keys => Values): "; print_r($combinedArray); // Using '+' operator for associative arrays (maintains first array's values for duplicate keys) $operatorArray1 = ["a" => 1, "b" => 2, "c" => 3]; $operatorArray2 = ["b" => 20, "d" => 4, "e" => 5]; $combinedWithOperator = $operatorArray1 + $operatorArray2; echo " Combined with '+' operator (first array's values for duplicate keys): "; print_r($combinedWithOperator); ?>