How do I add elements to an array only if they aren\'t in there already? I have the following:
$a=array(); // organize the array foreach($array as $k=>$v)
Try adding as key instead of value:
Adding an entry
function addEntry($entry) { $this->entries[$entry] = true; }
Getting all entries
function getEntries() { return array_keys($this->enties); }