PHP code example of cartware / custombase
1. Go to this page and download the library: Download cartware/custombase 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/ */
cartware / custombase example snippets
use Cartware\CustomBase\CustomBase;
class Base12 {
use CustomBase;
protected const CUSTOMBASE_ALPHABET = '0123456789AB';
}
$base12 = new Base12();
$base12->encode(9); # 9
$base12->encode(10); # A
$base12->encode(11); # B
$base12->encode(12); # 10
$base12->decode(16); # 18
$base12->decode('AB'); # 131