php email邮箱正则
(编辑:jimmy 日期: 2025/10/26 浏览:3 次 )
1.验证email:
< "/^[a-z]([a-z0-9]*[-_\.]",$email)){
echo “Your email address is correct!”;}
else{
echo "Please try again!";
}
"htmlcode">
$str = '';
$isMatched = preg_match('/^\w[-\w.+]*@([A-Za-z0-9][-A-Za-z0-9]+\.)+[A-Za-z]{2,14}$/', $str, $matches);
var_dump($isMatched, $matches);
匹配Email邮箱格式的正则表达式:
/^[a-z]([a-z0-9]*[-_]"htmlcode">
<"/([a-z0-9]*[-_\.]";
preg_match_all($pattern,$str,$emailArr);
return $emailArr[0];
}
$emailstr = "9999@qq.com.cn俺不是米vi地方就开iid邮件列表:fuyongjie@163.com 和hh@qq.com;.;;,fuyongjie.100@yahoo.com,fu-1999@sina.com";
$emailArr = getEmail($emailstr);
echo "<pre>";
print_r($emailArr);
echo "</pre>";
?>
打印如下:
Array
(
[0] => 9999@qq.com.cn
[1] => fuyongjie@163.com
[2] => hh@qq.com
[3] => fuyongjie.100@yahoo.com
[4] => fu-1999@sina.com
)
3.比较:第2里的正则里没有了第1的^和$;
下一篇:php获取地址栏信息的代码
在去年的5月23日,借助Intel Bridge Technology以及Intel Celadon两项技术的驱动,Intel为PC用户带来了Android On Windows(AOW)平台,并携手国内软件公司腾讯共同推出了腾讯应用宝电脑版,将Windows与安卓两大生态进行了融合,PC的使用体验随即被带入到了一个全新的阶段。