A PHP implementation of an HTML obfuscator. The obfuscator encodes a provided text into different numeric codes to mask content from simple automated scrapers while the content keeps rendering normally in a browser.
You can install the package via composer:
composer require kudashevs/html-obfuscatorThe obfuscator can be used both statically and dynamically. The only limitation of the dynamic approach is that it is not possible to provide custom settings during the instantiation. However, in the vast majority of use cases, these settings are not needed. I would recommend using the dynamic approach because it is generally more flexible.
use Kudashevs\HtmlObfuscator\Obfuscator;
$text = 'the answer for 3 + 2 is';
// static invocation
$obfuscated = Obfuscator::obfuscate($text);
// dynamic invocation
$obfuscator = new Obfuscator();
$obfuscated = $obfuscator->obfuscate($text);
print_r($obfuscated);
// both cases will result into
the answer for 3 + 2 iscomposer testPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Note: Please make sure to update tests as appropriate.
The MIT License (MIT). Please see the License file for more information.