With this snippet, you can encode any email address into HTML entities so that spam bots do not find it.
function encode_email($email=’info@domain.com’, $linkText=’Contact Us’, $attrs =’class=”emailencoder”‘ )
{
// remplazar aroba y puntos
$email = str_replace(‘@’, ‘@’, $email);
$email = str_replace(‘.’, ‘.’, $email);
$email = str_split($email, 5);
$linkText = str_replace(‘@’, ‘@’, $linkText);
$linkText = str_replace(‘.’, ‘.’, $linkText);
$linkText = str_split($linkText, 5);
$part1 = ‘‘;
$part4 = ‘‘;
$encoded = ‘‘;
return $encoded;
}