Protecting Your Public E-mail Address

March 17th, 2013 by Laeeq | No comments

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 = “web.revisions@gmail.com”;
  8. $protected_email = protectEmail($email);
  9. echo “Result Email: “.$protected_email;
  10. ?>

Result Email: web dot revisions at gmail dot com

 

You can subscribe to PHPZAG.COM posts by Email

 

 

 

  1. No comments yet.
  1. No trackbacks yet.