Valid email address filter


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

I think this is php 5 only


Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. $emailAddress = "my_email_test@mail server.com";
  4.  
  5. if(!filter_var($emailAddress, FILTER_VALIDATE_EMAIL))
  6. {
  7. echo "Submitted address is faulty";
  8. }
  9. else
  10. {
  11. echo "Address submitted successfully";
  12. }
  13.  
  14. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.