Question

How to implement set theory operations in pure php?

Was it helpful?

Solution

Which operations are you looking for? What are you trying to accomplish?

In PHP an array is (imperfectly) analogous to a set, and PHP has array_intersect, array_merge (union), and array_diff (complement) functions built in. There's also array_uintersect and array_udiff for handling complex objects whose comparisons are not so straightforward.

Is there further functionality you need?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top