remove item by value from array on button click


[php]function remove_element($arr, $val){
foreach ($arr as $key => $value){
if ($arr[$key] == $val){
return $arr = array_values($arr);
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


never mind i sorted it