Protecting Your Public E-mail Address

If you want to protect a publicly displayed email address from being captured by an e-mail address harvester. To protect the email address, you can manage the email address which is only read by human being but not recognized as a standard e-mail address to a program. For I have a written a simple php function which convert special symbol in an email address with English words, making the e-mail address unrecognizable as such to an address harvester. So @ becomes at, _ becomes underscore, and – becomes dash.

  1. <?php
  2. function protectEmail($email){
  3. $search = array(“.”,“-“,“_”,“@”);
  4. $replace = array(” dot “, ” dash “, ” underscore “, ” at “);
  5. return str_replace($search, $replace, $email);
  6. }
  7. $email = “”;
  8. $protected_email = protectEmail($email);
  9. echo “Result Email: “.$protected_email;
  10. ?>

Result Email: web dot revisions at gmail dot com



A web developer who has a love for creativity and enjoys experimenting with various techniques in both web design and development. If you would like to be kept up to date with our posts, you can follow us on Twitter, or even by subscribing to our RSS Feed.

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera