A quick-and-dirty library to obfuscate sensitive strings by dynamically creating special characters to print them out. Not foolproof by any means.
composer require joetannenbaum/obfuscate
use Obfuscate\Obfuscate;
require __DIR__ . '/vendor/autoload.php';
echo Obfuscate::str('this is a secret!');
echo Obfuscate::mailto('[email protected]');
...results in (different every time, still renders properly in HTML):
this is a secret!
<a href="mailto:obfuscate@joe.codes">obfuscate@joe.codes</a>
If you're using Laravel, this package automatically adds a Blade helper:
@obfuscate('this is a secret!')
@mailto('[email protected]')