This is an official IHost example and the address given are fictitiousReal quick one so I am trying to get a specific bit of information from an API.
It's an IHost api I am calling and i get a response similar to this:
{
"result": {
"deposits": [
{
"deposit_id": 36,
"share_id": 2,
"current_amount": 53.077553,
"total_deposited": 24.91567,
"total_earned": 28.146885,
"withdraw_address": "GcUgnY5fFwTv9ef8rsggdxbdQzLEUxpp4c",
"deposit_address": "GfUgnY5sFwTf9ez8rovtdxdEQzLcbxpb4c"
},
{
"deposit_id": 37,
"share_id": 5,
"current_amount": 885.9591,
"total_deposited": 521.92,
"total_earned": 472.30566,
"withdraw_address": "gHWHPs21H8UsSNcbfWxvn5XssAxFkcuZYe",
"deposit_address": "g4sbWWtD3tf16Dsd8wiaJkar3zhJ82qNKP"
},
{
"deposit_id": 38,
"share_id": 6,
"current_amount": 754.5115,
"total_deposited": 548.52997,
"total_earned": 416.25214,
"withdraw_address": "LLqWFFJkNSog6VwsbPWEWE4KcXJrzB6t1K",
"deposit_address": "LW5Vbt1gEkvVQzfVcpLmidLPpcED1Yp3yu"
}
]
},
"error": ""
}
By using
print_r($obj->result->deposits);
BUT how do I just get a specific bit of info for example if I want to display total_earned on deposit ID38 what would I have to alter
print_r($obj->result->deposits);
to to make it work ?
Many Thanks for any help offered
TT