Home > Backend Development > PHP Tutorial > 判断是否为指定长度内字符串的php函数_php技巧

判断是否为指定长度内字符串的php函数_php技巧

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-17 09:28:00
Original
1227 people have browsed it
复制代码 代码如下:

//———————————————————————————–
// 函数名:CheckLengthBetween($C_char, $I_len1, $I_len2=100)
// 作 用:判断是否为指定长度内字符串
// 参 数:$C_char(待检测的字符串)
// $I_len1 (目标字符串长度的下限)
// $I_len2 (目标字符串长度的上限)
// 返回值:布尔值
// 备 注:无
//———————————————————————————–
function CheckLengthBetween($C_cahr, $I_len1, $I_len2=100)
{
$C_cahr = trim($C_cahr);
if (strlen($C_cahr) if (strlen($C_cahr) > $I_len2) return false;
return true;
}
//———————————————————————————–
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template