views:

68

answers:

2

Does anyone have any examples or know of any resources that show how to implement set theory operations in pure php?

+1  A: 

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?

Jordan
+1  A: 

Probably you'll already saw those links:

http://jamietalbot.com/2010/02/04/set-operations-in-php/

http://oreilly.com/catalog/progphp/chapter/ch05.html

DaNieL