We used this to de-duplicate results from a variety of overlapping queries. $input = array_map("unserialize", array_unique(array_map("serialize", $input)));