Create a gist now

Instantly share code, notes, and snippets.

[ 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