Good afternoon. I tried to search here, but I did not find what I needed. I'm working with JSON, and I have received the following return string:
{
"success": 1,
"return": {
"100025362": {
"pair": "BRL",
"type": "sell",
"amount": 21.615,
"rate": 0.258,
"timestamp_created": 1418654530,
"status": 0
},
...
}
}
This number 100025362
, is an open order that I have.
But at the time of this JSON query, I do not have the order number.
I would need to run all orders, to get to status.
If I had the order number, I would have no problem, I would:
$json_ActiveOrder = json_decode($stringJSON);
$ActiveOrderStatus = $json_ActiveOrder->return->100025362->status;
But since I do not have access to the number at this time, how would I run all the orders? In the case 100025362
??
I tried to receive only up to return
, and loop, but I have the following errors with the code below:
$json_ActiveOrder = json_decode($retorno_ActiveOrder);
$ActiveOrder = $json_ActiveOrder->return;
foreach($ActiveOrder as $f) {
echo $f[0];
}
The error exits:
( ! ) Notice: Undefined property: stdClass::$return in C:\wamp\www\bitcoin\index.php on line 132
Call Stack
# Time Memory Function Location
1 0.0000 149328 {main}( ) ..\index.php:0
( ! ) Warning: Invalid argument supplied for foreach() in C:\wamp\www\bitcoin\index.php on line 134
Call Stack
# Time Memory Function Location
1 0.0000 149328 {main}( ) ..\index.php:0