PHP code example of codwelt / php-obfuscator

1. Go to this page and download the library: Download codwelt/php-obfuscator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codwelt / php-obfuscator example snippets


use pmaslak\PhpObfuscator\Obfuscator;

$obfuscator = new Obfuscator([
    'allowed_mime_types' => ['text/x-php'],
    'obfuscation_options' => ['no-obfuscate-variable-name', 'no-obfuscate-method-name', 'no-obfuscate-class-name', 'no-obfuscate-property-name']
]);

$obfuscator->obfuscateFile('/dir/example_file.php', '/new_dir/obfuscated_file.php');

$obfuscator->obfuscateDirectory('/dir/to_obfuscate/', '/dir/obfuscated/');