PHP code example of mbezhanov / ethereum-converter

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

    

mbezhanov / ethereum-converter example snippets


$converter = new Bezhanov\Ethereum\Converter();

// convert from Wei to another unit:
$value = $converter->fromWei('21000000000000', 'finney');
echo $value; // "0.021"

// convert from another unit to Wei:
$value = $converter->toWei('1', 'ether');
echo $value; // "1000000000000000000"