1. Go to this page and download the library: Download tuupola/base62 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/ */
tuupola / base62 example snippets
use Tuupola\Base62;
print Base62::GMP; /* 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz */
print Base62::INVERTED; /* 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ */
$default = new Base62(["characters" => Base62::GMP]);
$inverted = new Base62(["characters" => Base62::INVERTED]);
print $default->encode("Hello world!"); /* T8dgcjRGuYUueWht */
print $inverted->encode("Hello world!"); /* t8DGCJrgUyuUEwHT */
print $default->encodeInteger(27); /* R */
print $inverted->encodeInteger(27); /* r */
if (function_exists("gmp_init")) {
$base62 = new Tuupola\Base62\GmpEncoder();
$base62->encode("Hello world!"); /* T8dgcjRGuYUueWht */
} else {
/* Handle error... */
}