Many languages have a “Set” data structure which typically only contain unique values from a particular collection of objects. For instance, if you add the integers 1, 4, 5, 1, 2, and 6 to the set, in the end the set would actually only contain 1, 4, 5, 2 and 6.
I haven’t observed any kind of collection like this in PHP. Is there such a collection built into the language, or does something need to be custom rolled?
Doubt there is anything built in, but it’s very simple to achieve: