PHP Check Email function

Source: Internet
Author: User

Check the work of e-mail for some registered classes of the site is very necessary, the following has a good function, you can refer to the next

The code is as follows: function is_valid_email_address ($email) {$qtext = ' [^//x0d//x22//x5c//x80-//xff] ';  $dtext = ' [^//x0d//x5b-//x5d//x80-//xff] ';  $atom = ' [^//x00-//x20//x22//x28//x29//x2c//x2e//x3a-//x3c '].  '//x3e//x40//x5b-//x5d//x7f-//xff]+ ';  $quoted _pair = '//x5c[//x00-//x7f] ';  $domain _literal = "//x5b ($dtext | $quoted _pair) *//x5d";  $quoted _string = "//x22 ($qtext | $quoted _pair) *//x22";  $domain _ref = $atom;  $sub _domain = "($domain _ref| $domain _literal)";  $word = "($atom | $quoted _string)";  $domain = "$sub _domain (//x2e$sub_domain) *";  $local _part = "$word (//x2e$word) *";  $addr _spec = "$local _part//x40$domain"; Return Preg_match ("!^ $addr _spec$!", $email)?  1:0; }
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.