Mailto: Email Obfuscation (ASCII)


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



Copy this code and paste it in your HTML
  1. function safeEmail($email)
  2. {
  3.  
  4. $obfuscatedEmail = '';
  5. $email = eregi_replace('#','', $email);
  6. $length = strlen($email);
  7.  
  8. for ($i = 0; $i < $length; $i++)
  9. {
  10. $obfuscatedEmail .= "&#" . ord($email[$i]);
  11. }
  12.  
  13. $return = '<a href="mailto:' . $obfuscatedEmail . '">'.$obfuscatedEmail.'</a>';
  14.  
  15. return $return;
  16. }

URL: http://www.givegoodweb.com/post/67/php-email-obfuscate

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.