A small function to detect whether it is a valid email address

WBOY
Release: 2016-07-25 09:02:50
Original
1349 people have browsed it
  1. /*
  2. // Function name: CheckEmailAddr($C_mailaddr)
  3. // Function: Determine whether it is a valid email address
  4. // Parameter: $C_mailaddr (email address to be detected)
  5. // Return value: Boolean value
  6. // Remarks: None
  7. */
  8. function CheckEmailAddr($C_mailaddr)
  9. {
  10. if (!eregi(“^[_a-z0-9-]+(.[_a-z0-9-] +)*@[a-z0-9-]+(.[a-z0-9-]+)*$”,
  11. $C_mailaddr))
  12. //(!ereg(“^[_a-zA-Z0- 9-]+(.[_a-zA-Z0-9-]+)*@[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-]+)*$”,
  13. $c_mailaddr))
  14. {
  15. return false;
  16. }
  17. return true;
  18. }
  19. ?>
Copy code


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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!