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 can try using "in_array":
function insert_value($value, &$_arr) { if (!in_array($value, $_arr)) { $_arr[] = $value; } }