<p>The suggested library for Bitcoin JSON-RPC via PHP is the <a href="https://github.com/aceat64/EasyBitcoin-PHP" rel="nofollow noreferrer">EasyBitcoin-PHP</a> library. <a href="https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#PHP" rel="nofollow noreferrer">Source</a></p>

<p>Here's a simple example:</p>

<pre><code>&lt;?php 
require("easybitcoin.php");

//authenticate
$bitcoin = new Bitcoin("RPCusername", "RPCpassword"); 

//execute ternary command
$send = $bitcoin-&gt;sendtoaddress("1SomeBitcoinAddy", 1); 
echo $send ? $send : "Oops an error: ".$bitcoin-&gt;error;   
?&gt; 
</code></pre>

<p>The first argument for <code>sendtoaddress()</code> is the address you want to send funds to, the second is the amount in whole bitcoins. </p>

CC BY-SA 3.0
2017-03-31T00:19:46.400Z
2017-03-31T00:19:46.400Z
m1xolyd1an
<pre><code>if(number_format($_POST['amount'], 8)&gt;.00009){

$amount=number_format($_POST['amount'], 8);

$bitcoin-&gt;sendfrom($this-&gt;session-&gt;userdata('account'), $_POST['address'], (float)$amount);

}
else{

echo "Tumbling is not possible vai php";

}
</code></pre>

CC BY-SA 4.0
2015-06-09T10:39:10.310Z
2019-08-09T02:02:29.923Z
2019-08-09T02:02:29.923Z
Md Shahadat Hossain
<p><code>$bitcoin-&gt;sendfrom($this-&gt;session-&gt;userdata('account'), $_POST['address'], number_format($_POST['amount'], 8));</code></p>

<p>but this isn't working. i got everything via json-rpc. but can't send or move money using  json-rpc. what is the problem?</p>

<bitcoind><json-rpc>
how to send money using json-rpc in bitcoin-cli for php?
Md Shahadat Hossain
# how to send money using json-rpc in bitcoin-cli for php?

(Asked by: username_0 on 2015-06-08)

`$bitcoin->sendfrom($this->session->userdata('account'), $_POST['address'], number_format($_POST['amount'], 8));`

but this isn't working. i got everything via json-rpc. but can't send or move money using json-rpc. what is the problem?

**Tags:** bitcoind, json-rpc


---

## 2 answers

### Answer by username_1 on 2017-03-31. Score: 1

The suggested library for Bitcoin JSON-RPC via PHP is the EasyBitcoin-PHP library. Source
Here's a simple example:
sendtoaddress("1SomeBitcoinAddy", 1); 
echo $send ? $send : "Oops an error: ".$bitcoin->error;   
?> 

The first argument for sendtoaddress() is the address you want to send funds to, the second is the amount in whole bitcoins.


---

### Answer by username_0 on 2015-06-09. Score: -1

if(number_format($_POST['amount'], 8)>.00009){

$amount=number_format($_POST['amount'], 8);

$bitcoin->sendfrom($this->session->userdata('account'), $_POST['address'], (float)$amount);

}
else{

echo "Tumbling is not possible vai php";

}


---

