PHP code example of delhombre / binary-converter

1. Go to this page and download the library: Download delhombre/binary-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/ */

    

delhombre / binary-converter example snippets


$converter = BinaryConverter::from(2024);

$bin = $converter->toBinary();

dd($bin); // "11111101000"

dd(BinaryConverter::from('2024')->toBinary()); // "11111101000"

dd(BinaryConverter::from('11111101000', 'binary')->toDecimal()); // 2024