2

i'am developing a web application that use a RestFul api, and this api sometime send to me a post json on webhook, the array in the json is :

[
    "address" => "example",
    "hash160" => "example",
    "balance" => example,
    "received" => example,
    "sent" => example,
    "unconfirmed_received" => 0,
    "unconfirmed_sent" => 0,
    "unconfirmed_transactions" => 0,
    "total_transactions_in" => 4,
    "total_transactions_out" => 10,
    "category" => "donations",
    "tag" => "example"
]

For decode this array on php I use

$Data=file_get_contents('php://input');
$Data=json_decode($Data, true);
$Adress=$Data['adress'];
$Sent=$Data['sent'];

Is this the right way to decode the json?Did it will work?

L.REW
  • 21
  • 1

0 Answers0