PHP code example of o6web / multiencoder
1. Go to this page and download the library: Download o6web/multiencoder 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/ */
o6web / multiencoder example snippets
use o6web\MultiEncoder\Encoder;
use o6web\MultiEncoder\Step;
// Define the encoding steps
$encode = [
// Steps can be existing functions or callable
new Step('strrev'),
new Step('base64_encode'),
];
// Define the decoding steps
$decode = [
new Step('base64_decode'),
new Step('strrev'),
];
$multiEncoder = new Translator($encode, $decode);
$data = 'This is a string';
$encoded_data = $multiEncoder->encode($data); // Z25pcnRzIGEgc2kgc2loVA==
$decoded_data = $multiEncoder->decode($encoded_data); // This is a string