PHP code example of asimlqt / encode-decode

1. Go to this page and download the library: Download asimlqt/encode-decode 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/ */

    

asimlqt / encode-decode example snippets


    try {
        $encoder = new Base64Url();
        $encoded = $encoder->encode("Encode/Decode library for PHP");
    } catch (EncodingException $e) {
        // handle exception
    }
    // encoded === "RW5jb2RlL0RlY29kZSBsaWJyYXJ5IGZvciBQSFA"

    try {
        $encoder = new Base64Url();
        $decoded = $encoder->decode("RW5jb2RlL0RlY29kZSBsaWJyYXJ5IGZvciBQSFA");
    } catch (DecodingException $e) {
        // handle exception
    }
    // decoded === "Encode/Decode library for PHP"