Posted By

Calvista on 09/16/10


Tagged

email php filter clean address normalize filtervar


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

Calvista


Clean up and normalize email address


 / Published in: PHP
 

Requires PHP 5.2 with filter_var()

  1. function cleanAddress($address)
  2. {
  3. return filter_var(strtolower(trim(preg_replace('/\\s+/', '', $address))), FILTER_SANITIZE_EMAIL);
  4. }

Report this snippet  

You need to login to post a comment.