tadd php example - electrum - Electrum Bitcoin wallet HTML git clone https://git.parazyd.org/electrum DIR Log DIR Files DIR Refs DIR Submodules --- DIR commit afae9a097e2bf39280589f3d1a456c5f70adc170 DIR parent 95393656aa1deb6c92d996aa0287b90cba5bc70e HTML Author: ThomasV <thomasv@electrum.org> Date: Tue, 1 Dec 2015 09:42:47 +0100 add php example Diffstat: A lib/www/example.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+), 0 deletions(-) --- DIR diff --git a/lib/www/example.php b/lib/www/example.php t@@ -0,0 +1,17 @@ +<?php + +require_once 'jsonRPCClient.php'; +$electrum = new jsonRPCClient('http://localhost:7777'); + +echo '<b>Wallet balance</b><br />'."\n"; +try { + + $balance = $electrum->getbalance(); + echo 'confirmed: <i>'.$balance['confirmed'].'</i><br />'."\n"; + echo 'unconfirmed: <i>'.$balance['unconfirmed'].'</i><br />'."\n"; + +} catch (Exception $e) { + echo nl2br($e->getMessage()).'<br />'."\n"; +} + +?>