union of two arrays in php code example Example: union of two arrays in php $union = array_unique(array_merge($a, $b));