判断一个字符串是不是email
浏览数 134925
赞
(0)
函数名:
is_email
/**
* @name 判断一个字符串是不是email
* @desc
* @param string $email 邮箱 待检查的email字符串
* @return boolean true表示是email格式,false表示不是email格式
*/
function is_email($email){
return preg_match('/^[a-zA-Z0-9]+([-_.][a-zA-Z0-9]+)*@([a-zA-Z0-9]+[-.])+([a-z]{2,10})$/ims',$email);
}