Skip to content

Instantly share code, notes, and snippets.

@eclarrrk
Last active May 25, 2018 13:00
Show Gist options
  • Save eclarrrk/349360b52e8822b69cb6fc499722520f to your computer and use it in GitHub Desktop.
Save eclarrrk/349360b52e8822b69cb6fc499722520f to your computer and use it in GitHub Desktop.
How to obfuscate an email address in PHP
1. Remove link around email address.
2. Wrap email address in <div class="reverse"></div>
3. Reverse the email address using strrev() or similar.
////////// example code //////////
<div class="reverse">
<?php echo strrev($emailAddress); ?>
</div>
////////// add to css file //////////
.reverse {
unicode-bidi: bidi-override;
direction: rtl;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment