You can use the keys of an associative array to model a set. Or even write yourself a set class:
class Set {
var $contents;
function Set() { $this->contents = array(); }
function Add($value) { $this->contents[$value] = true; }
function Contains($value) { return (bool) @ $this->contents[$value]; }
function Remove($value) { delete $this->contents[$value]; }
}
Something like that.
Above is untested and probably syntactically correct, but you get the gist. Implementations of union, intersection, difference, symmetric difference, isempty, count, are left as exercises for the reader 🙂
Mark