$fsec = '56,56,56';$num = explode(",", $fsec);foreach($num as $key=>$val){ if(!ctype_digit($val)){ unset($num[$key]); }}$fsec = implode(",", $num);