<?php
function check_email($email){
$preg="/^\w+([-_.]\w+)*@\w+([-_.]\w+)*(\.\w+){0,3}$/i";
$res=preg_match($preg,$email);
return $res;//匹配成功返回1,匹配失败返回0
}
$result= check_email('[email protected]');
var_dump($result);
?>
写一个验证邮箱格式是否正确的函数
猜你喜欢
转载自blog.csdn.net/living_ren/article/details/79504177
今日推荐
周排行