Skip to content

Instantly share code, notes, and snippets.

@fermino
Created November 25, 2014 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fermino/812f2731f9d92a2dfafe to your computer and use it in GitHub Desktop.
Save fermino/812f2731f9d92a2dfafe to your computer and use it in GitHub Desktop.
Email HTML obfuscator
<?php
function ObfuscateEmail($Email)
{
$Code = 'mailto:';
$Length = strlen($Email);
for($i = 0; $i < $Length; $i++)
{
$Char = dechex(ord($Email[$i]));
$Code .= "&#x{$Char};";
}
return $Code;
}
echo ObfuscateEmail('your-email@domain.tld');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment