function removeElement(&$nums, $val) {
$count = count($nums);
foreach ($nums as $k => $v) {
if ($v == $val) {
unset($nums[$k]);
$count--;
}
}
return $count;
}
网友评论