php手机、邮箱规则验证

    function checkPhone($phone)
    {
        $check = '/^(1(([3456789][0-9])|(47)))d{8}$/';
        if (preg_match($check, $phone)) {
            return true;
        } else {
            return false;
        }
    }
function checkEmail($email)
{
    // Create the syntactical validation regular expression
    $regexp = "/^([_a-z0-9-]+)(.[_a-z0-9-]+)*@([a-z0-9-]+)(.[a-z0-9-]+)*(.[a-z]{2,4})$/";
    if (preg_match($regexp, $email)) {
        return true;
    } else {
        return false;
    }
}
╰︶﹉⋛⋋⊱⋋๑๑⋌⊰⋌⋚﹉︶╯
原文地址:https://www.cnblogs.com/zhangcheng001/p/13850734.html