$arr = [1,2,3,4,5,'a','b'];
$del_val = 2;
if(($key = array_search($del_val, $arr)) !== false) {
unset($arr[$key]);
}
print_r($arr);
$arr = [1,2,3,4,5,'a','b'];
$del_val = 2;
if(($key = array_search($del_val, $arr)) !== false) {
unset($arr[$key]);
}
print_r($arr);