// Email Obfuscator // Modified from http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=1533&lngWId=8 function generateEmail($username, $domain="jeremygustafson.net", $displayName=0, $subjectLine=0, $bodyText=0) { // When jeremygustafson.net is the real domain, the domain argument can be passed as 0 to not write "@jg.net" as part of the visible text return '' . ($displayName ? $displayName : obfuscateString($username . ($domain ? '@' . $domain : ''))) . ''; } function obfuscateString($string) { $encryptedString = ''; $len = strlen($string); for ($i=0;$i<$len;$i++) { $encryptedString .= "&#" . ord($string[$i]) . ";"; } return $encryptedString; }