Home > Backend Development > PHP Tutorial > 关于邮箱验证的有关问题,请高手帮忙看一下

关于邮箱验证的有关问题,请高手帮忙看一下

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 10:31:06
Original
842 people have browsed it

关于邮箱验证的问题,请高手帮忙看一下
if (!ereg("^[a-zA-Z0-9_.]+@([a-zA-Z0-9_]+.)+[a-zA-Z]{2,3}$", $email)){



帮看看这个有问题吗?能验证所有规则的邮箱吗?
[email protected]
[email protected]
[email protected]

另外邮箱中一般都是下划线“_”,但今天有人提出也有“-”这种划线的邮箱,请问以上代码如何修改可以让带有“-”这种划线的邮箱也通过?
[email protected]

------解决方案--------------------
if (!ereg("^[a-zA-Z0-9_.-]+@([a-zA-Z0-9_]+.)+[a-zA-Z]{2,3}$", $email)){

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
PHP mail function cannot send email completely
From 1970-01-01 08:00:00
0
0
0
PHP mail function cannot complete sending email
From 1970-01-01 08:00:00
0
0
0
PHP mail function cannot complete sending email
From 1970-01-01 08:00:00
0
0
0
PHP mail function cannot send email completely
From 1970-01-01 08:00:00
0
0
0
PHP mail function did not complete sending email
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template