function v_leng($str, $min, $max)
{
if ($min > 0 && strlen($str) < $min) {
$_status = "too_short";
//如果定义最小长度,且短于,则返回太短
} elseif ($max > 0 && strlen($str) > $max) {
$_status = "too_long";
//如果定义最大长度,且长于,则返回太长
} else {
$_status = "ok";
//返回正确
}
return $_status;
}