1. Go to this page and download the library: Download nabeghe/alphanum 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/ */
use Nabeghe\Alphanum\Alphanum;
$bigId = '123456789012345678901234567890';
// Encode large decimal string
$shortCode = Alphanum::generate($bigId);
// Decode back to arbitrary-precision decimal string
$restoredBigId = Alphanum::toBigDecimal($shortCode);
echo $restoredBigId; // '123456789012345678901234567890'
// Auto-decoder: returns int if it fits in PHP_INT_MAX, or string if it exceeds
$val = Alphanum::decode($shortCode);
use Nabeghe\Alphanum\Alphanum;
// Pad to at least 6 characters (padded with '0' by default)
echo Alphanum::generate(5, null, 6); // '000005'
// Custom pad character
echo Alphanum::generate(10, null, 6, 'X'); // 'XXXXXA'
// Manual pad / unpad helpers
echo Alphanum::pad('1f', 6, '0'); // '00001f'
echo Alphanum::unpad('00001f', '0'); // '1f'