Use this function to hide an e-mail address from spam-bots on your website. Use this function to convert the e-mail address into Unicode values and add the html tag and optional extra e-mail info like subject and body text.
PHP Code:
<?php
function hide_mailto($mail, $label, $subject = "", $body = "") {
$chars = preg_split("//", $mail, -1, PREG_SPLIT_NO_EMPTY);
$new_mail = "<a href="mailto:";
foreach ($chars as $val) {
$new_mail .= "&#".ord($val).";";
}
$new_mail .= ($subject != "" && $body != "") ? "?subject=".$subject."&body=".$body : "";
$new_mail .= "">".$label."</a>";
return $new_mail;
}
?>