Is there an array function in PHP that somehow does array_merge, comparing the values, ignoring the keys? I think that array_unique(array_merge($a, $b
array_unique(array_merge($a, $b
array_merge will ignore numeric keys, so in your example array_merge($a, $b) would give you $ab, there is no need to call array_unique().
array_merge($a, $b)
$ab
array_unique()
if you have string keys (i.e. an associative array) use array_values() first:
array_values()
array_merge(array_values($a), array_values($b));