$set1 = [1, 2, 3]; $set2 = [3, 4, 5]; $result = array_merge($set1, $set2); print_r($result); // Output: [1, 2, 3, 3, 4, 5]
$set1 = [2, 4, 6]; $set2 = [3, 6, 9]; $result = array_unique(array_merge($set1, $set2)); print_r($result); // Output: [2, 4, 6, 3, 9]Here, we have two arrays with some overlapping values. We use the `array_merge` function to combine them into a single array, and then use the `array_unique` function to remove any duplicate values. The resulting array includes only the unique values from both arrays. Package library: This is a built-in PHP function and does not require any external package libraries.