implementing set theory operations in php
-
29-09-2019 - |
Question
How to implement set theory operations in pure php?
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?
OTHER TIPS
Probably you'll already saw those links:
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow