I need to merge two arrays into 1 array but what I need is to remove before the main data they b oth have in common (duplicated values i mean), I need only unique values whe
Faster solution:
function concatArrays($arrays){ $buf = []; foreach($arrays as $arr){ foreach($arr as $v){ $buf[$v] = true; } } return array_keys($buf); } $array = concatArrays([$array1, $array2]);