add php example
This commit is contained in:
parent
95393656aa
commit
afae9a097e
17
lib/www/example.php
Normal file
17
lib/www/example.php
Normal file
@ -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";
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user