Calling RPC method, yields an instance of Denpa\Bitcoin\BitcoindResponse class, which provides different ways to access and process response data.

Array Access

You can work with response as regular php array.

// $block = bitcoind()->getBlock($blockhash);
if (isset($block['height'])) {
    echo $block['height'];
}

Dot Notation

Any of the methods listed in Response Methods can be used on certain path provided as dot notation.

// $block = bitcoind()->getBlock($blockhash);
$txid = '5f2a97541613c5122290e17a6c654c443338e895d79b7131622778f6f798f851';
if ($block('tx')->contains($txid)) {
	// block contains transaction with this txid
}

or get certain value

// $block = bitcoind()->getBlock($blockhash);
echo $block('tx.0');

Updated: