/**
* 验证输入的邮箱格式是否合法
* @access public
* @param string
email)
{
$chars = “/^([a-z0-9+]|\-|\.)+@(([a-z0-9]|\-)+\.)+[a-z]{2,6}$/i”;
if (strpos(KaTeX parse error: Expected 'EOF', got '&' at position 23: …'@') !== false &̲& strpos(email, ‘.’) !== false)
{
if (preg_match($chars, $email))
{
return true;
}else{
return false;
}
}else{
return false;
}
}
/**
* 验证输入的手机号码是否合法
* @access public
* @param string
mobile_phone)
{
|15[0-9]{1}[0-9]{8}
|17[0-9]{1}[0-9]{8}
chars, $mobile_phone))
{
return true;
}
return false;
}
简单的手机邮箱验证
猜你喜欢
转载自blog.csdn.net/weixin_43023551/article/details/88101515
今日推荐
周排行