// 函数名:checktelephone($c_telephone)
// 作 用:判断是否为合法电话号码
// 参 数:$c_telephone(待检测的电话号码)
// 返回值:布尔值
// 备 注:无
//-----------------------------------------------------------------------------------
-------
function checktelephone($c_telephone)
{
if (!ereg(^[+]?[0-9]+([xx-][0-9]+)*$, $c_telephone)) return false;
return true;
}
//-----------------------------------------------------------------------------------
-------
//-----------------------------------------------------------------------------------
-------
// 函数名:checkvaluebetween($n_var, $n_val1, $n_val2)
// 作 用:判断是否是某一范围内的合法值
// 参 数:$n_var 待检测的值
// $n_var1 待检测值的上限
// $n_var2 待检测值的下限
// 返回值:布尔值
// 备 注:无
//-----------------------------------------------------------------------------------
-------
function checkvaluebetween($n_var, $n_val1, $n_val2)
{
if ($n_var $n_var2)
{
return false;
}
return true;
}
//-----------------------------------------------------------------------------------
-------
//-----------------------------------------------------------------------------------
-------
// 函数名:checkpost($c_post)
// 作 用:判断是否为合法邮编(固定长度)
// 参 数:$c_post(待check的邮政编码)
// 返回值:布尔值
// 备 注:无
//-----------------------------------------------------------------------------------
-------
function checkpost($c_post)
{
$c_post=trim($c_post);
if (strlen($c_post) == 6)
{
if(!ereg(^[+]?[_0-9]*$,$c_post))
{
return true;;
}else
{
return false;
}
}else
{
return false;;
}
}
//-----------------------------------------------------------------------------------
-------
//-----------------------------------------------------------------------------------
-------
http://www.bkjia.com/phpjc/532630.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/532630.htmltecharticle// 函数名:checktelephone($c_telephone) // 作 用:判断是否为合法电话号码 // 参 数:$c_telephone(待检测的电话号码) // 返回值:布尔值 // 备 注:...