echo "<pre>"; print_r($formdetails['taglist']); echo "</pre>"; foreach ($formdetails['taglist'] AS $k => $v) { if ($v == $tagtodelete) { echo $v . $tagtodelete; unset($formdetails['taglist'][$k]); } } echo "<pre>"; print_r($formdetails['taglist']); echo "</pre>"; die;