当前位置:Gxlcms > PHP教程 > php关于邮箱验证的正则表达式

php关于邮箱验证的正则表达式

时间:2021-07-01 10:21:17 帮助过:3人阅读

本篇文章主要介绍php关于邮箱验证的正则表达式,感兴趣的朋友参考下,希望对大家有所帮助。代码如下:

  1. class isEmail{
  2. public function run($email){
  3. if(ereg("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+",$email)){
  4. return true;
  5. }else{
  6. return false;
  7. }
  8. }
  9. }$isEmail=new isEmail;if($isEmail->run("going")==false){
  10. echo "email is wrong";
  11. }

相关推荐:

PHP正则匹配所有字符失败的原因及解决办法

基于PHP正则零宽断言的使用详解

PHP正则表达式(增加177手机号)

以上就是php关于邮箱验证的正则表达式的详细内容,更多请关注Gxl网其它相关文章!

人气教程排行