Created
November 25, 2014 21:49
-
-
Save fermino/812f2731f9d92a2dfafe to your computer and use it in GitHub Desktop.
Email HTML obfuscator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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('[email protected]'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment