Validate email address PHP


/ Published in: PHP
Save to your folder(s)

This snippet is a PHP function that checks if an email address is valid


Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. function check_email($email)
  4. {
  5. if(!filter_var($email, FILTER_VALIDATE_EMAIL))
  6. {
  7. return false;
  8. }
  9. else
  10. {
  11. return true;
  12. }
  13. }
  14. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.