Foloowing is my out put of data, Now I need to show in label the 'amout' and 'trxID'. Please help me.

{
  "transaction": {
    "amount": "29",
    "counter": "1",
    "currency": "BDT",
    "receiver": "01811700563",
    "reference": "a",
    "sender": "01711643998",
    "service": "Payment",
    "trxId": "270413065",
    "trxStatus": "0000",
    "trxTimestamp": "2013-07-02T00:00:00+06:00"
  }
}
Member Avatar for diafol

Just a note on json_decode:

Remember to set the second parameter to true, otherwise you'll get an awkward standard object instead of an associative array:

$array = json_decode($json, true);
$object = json_decode($json);
$JSONdata = json_decode($jSOnString);
echo $JSONdata[0]->amount;
echo $JSONdata[0]->trxId;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.