Home >Backend Development >PHP Tutorial >PHP regular verification email function

PHP regular verification email function

WBOY
WBOYOriginal
2016-07-25 08:55:011459browse
  1. function isemail($email) {
  2. return strlen($email) > 8 && preg_match("/^[-_+.[:alnum:]]+@((([ [:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]]).)+([a-z]{2,4})|(([0- 9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5] ).){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[ 2][5][0-5]))$/i", $email);
  3. }
  4. if(!isemail($_POST['email'])) {
  5. echo "Sorry, the verification email address is incorrect! ";
  6. exit();
  7. }
  8. ?>
Copy code


Statement:
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