1. Go to this page and download the library: Download graphita/mathematics 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/ */
graphita / mathematics example snippets
use Graphita\Mathematics\BaseConvert;
// Convert a Number from Base 10 to Base 2
$result = BaseConvert::convert(6)->to(2)->getResult(); // 110
$resultArray = BaseConvert::convert(6)->to(2)->getResultArray(); // [1,1,0]
// Convert a Number from Base 8 to Base 10
$result = BaseConvert::convert(20, 8)->to(10)->getResult(); // 16
// Convert a Number from Base 16 with Source Characters Map to Base 10
$result = BaseConvert::convert('FF', 16, '0123456789ABCDEF')->to(10)->getResult(); // 255
// Convert a Number from Base 10 to Base 16 with Destination Characters Map
$result = BaseConvert::convert(255)->to(16, '0123456789ABCDEF')->getResult(); // FF
// Convert a Number from Base 16 with Source Characters Map to Base 10 with Destination Characters Map
$result = BaseConvert::convert('FF', 16, '0123456789ABCDEF')->to(10, 'ZYXWVUTSRQ')->getResult(); // XUU