php正则验证手机、邮箱

//验证电话
private function reg_phone($phone){
        if (preg_match("/^13[0-9]{1}[0-9]{8}$|15[0189]{1}[0-9]{8}$|189[0-9]{8}$/",$phone){
            return true;
        else{
            return false;
        }
    }
//验证邮箱
private function check_email($mail){
    if(preg_match('/^[w-.]+@[w-.]+(.w+)+$/'$mail))
        return true
    }else
        return false
    
}

原文地址:https://www.cnblogs.com/shaoguan/p/7336974.html