remove item by value from array on button click


#1

[php]function remove_element($arr, $val){
foreach ($arr as $key => $value){
if ($arr[$key] == $val){
unset($arr[$key]);
}
}
return $arr = array_values($arr);
}
[/php]
how can i set a form to remove a item from an array on button click. i have the cde above but cant get it to work with my form


#2

never mind i sorted it