Merge two arrays containing objects and remove duplicate values

You can combine the array_merge() function with the array_unique() function (both titles are pretty self-explanatory)

$array = array_unique (array_merge ($array1, $array2));

Leave a Comment