Skip to content

Instantly share code, notes, and snippets.

@phpfiddle
Created February 10, 2017 05:56
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 phpfiddle/7cbf97f92e0f472282f2f277618366e4 to your computer and use it in GitHub Desktop.
Save phpfiddle/7cbf97f92e0f472282f2f277618366e4 to your computer and use it in GitHub Desktop.
[ Posted by Fiddler ] Encode email address - Github
<?php
/**
* Encode email
*
*/
function encode_email($e) {
$output = '';
for ($i = 0; $i < strlen($e); $i++) { $output .= '&#'.ord($e[$i]).';'; }
return $output;
}
echo encode_email("myaddress@gmail.com");
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment