commit afae9a097e2bf39280589f3d1a456c5f70adc170 parent 95393656aa1deb6c92d996aa0287b90cba5bc70e 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(-)
diff --git a/lib/www/example.php b/lib/www/example.php @@ -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"; +} + +?>