PHP code example of justalinko / niki264

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

    

justalinko / niki264 example snippets



i264 = new justalinko\niki264\Niki264();

// encoding base64 with key
echo $niki264->encode('Hello World!' , 'secret');
// output : UOJuvO8aJ29yvOSk

// decoding base64 with key
echo $niki264->decode('UOJuvO8aJ29yvOSk' , 'secret');
// output : Hello World!

// encoding alphabet to numeric
echo $niki264->alpha2num('hello there');
// output : 961515180115961136

// decoding numeric to alphabet
echo $niki264->num2alpha('961515180115961136');
// output : hello there

// encoding safe mode ( to lowercase alphabet )
echo $niki264->alpha2numSafe('Hello World!'); 
// output : 961515180115961136