PHP code example of btccom / ezbitcoind-php
1. Go to this page and download the library: Download btccom/ezbitcoind-php 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/ */
btccom / ezbitcoind-php example snippets
$rpc = new Btccom\BitcoindRPC\BitcoindRPC("http://rpcuser:rpcpassword@localhost:18332");
var_dump($rpc->getInfo()['blocks']);
var_dump($rpc->getBlockCount());
var_dump($rpc->getBlockHash($rpc->getBlockCount()));
var_dump(count($rpc->getBlock($rpc->getBlockHash($rpc->getBlockCount()))['tx']));