Home > php教程 > PHP源码 > 基于php的正则判断邮箱格式是否合法

基于php的正则判断邮箱格式是否合法

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 08:47:54
Original
1567 people have browsed it
跳至 [1] [全屏预览]
//检测邮箱
function isEmail($val){
    $patrn='/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|\-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/';
    if(preg_match($patrn,$val)){
        if(_filterTempMail($val)){
            return true;
        }else{
            return false;
        }
    }else{
        return false;
    }
}
Copy after login
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template