Steve Waag from
Lacanche Ranges was able to translate the ASP in
Masking Your Email Address to PHP.
<?php
function maskEmail($email) {
$maskedEmail = '';
for ($j = 0; $j < strlen($email); $j++) {
$maskedEmail .= '&#' . ord(substr($email, $j, 1)) . ';' ;
}
$emailHtml = '<a href="m&#' . ord('a') . ';&#' . ord('i') . ';&#' . ord('l')
. ';&#' . ord('t') . ';o:' . $maskedEmail . '">' . $maskedEmail . '</a>';
return $emailHtml;
}
?>
<p>For more information email me at
<?php echo maskEmail('someEmail@someDomain.net') ?>.</p>
Labels: Email, PHP, Security