PHP code example of bocharsky-bw / numeral-system-converter
1. Go to this page and download the library: Download bocharsky-bw/numeral-system-converter 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/ */
bocharsky-bw / numeral-system-converter example snippets
use BW\NumeralSystem\Converter;
echo '<pre>';
print Converter::fromDec(9, Converter::MIN_RADIX) ."\n";
print Converter::toDec('1001', Converter::MIN_RADIX) ."\n";
print "\n";
print Converter::fromDec(11, 16) ."\n";
print Converter::toDec('B', 16) ."\n";
print "\n";
print Converter::fromDec(94276256, Converter::MAX_RADIX) ."\n";
print Converter::toDec('2!w54', Converter::MAX_RADIX) ."\n";
print "\n";
echo '</pre>';