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; } }
╰︶﹉⋛⋋⊱⋋๑๑⋌⊰⋌⋚﹉︶╯