PHP code example of yowcow / mime-base64-urlsafe

1. Go to this page and download the library: Download yowcow/mime-base64-urlsafe 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/ */

    

yowcow / mime-base64-urlsafe example snippets


$xml = '<hello>world</hello>';

$query_safe_data = Base64URLSafe::urlsafe_b64encode(gzdeflate($xml));

echo http_build_query(array('data' => $query_safe_data), '&amp;');

$query_safe_data = $_GET['data'];

$xml = gzinflate(Base64URLSafe::urlsafe_b64decode($query_safe_data));

echo $xml;