kudashevs / html-obfuscator
A PHP implementation of an HTML obfuscator.
Requires
- php: ^8.2
Requires (Dev)
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0|^12.0|^13.0
This package is auto-updated.
Last update: 2026-08-04 15:16:54 UTC
README
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.
Installation
You can install the package via composer:
composer require kudashevs/html-obfuscator
Usage
The 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 is
Testing
composer test
Contributing
Pull 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.
License
The MIT License (MIT). Please see the License file for more information.