1. Judgment Email:
The code is as follows
function is_email($email){
return strlen($email) > 6 && preg_match("/^[w-.]+@[w-]+(.w+)+$/", $email);
}
?>
2. Determine Url:
The code is as follows
function is_url($str){
return preg_match("/^http://[A-Za-z0-9]+.[A-Za-z0-9]+[/=?%-&_~`@[]':+!]*( [^<>"])*$/", $str);
}
3. Determine the mobile phone number:
The code is as follows
function is_mobile($str){
Return preg_match("/^(((d{3}))|(d{3}-))?13d{9}$/", $str);
}