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)
You'd have to check each value against in_array:
$a=array(); // organize the array by cusip foreach($array as $k=>$v){ foreach($v as $key=>$value){ if(!in_array($value, $a)){ $a[]=$value; } } }