I am trying to access decoded json elements that is in just one array, example:
[
{
timestamp: 1509523044,
tid: 83450451,
price: "6381.0",
amount: "1.0",
type: "sell"
},
{
timestamp: 1509523044,
tid: 83450448,
price: "6380.0",
amount: "1.12894377",
type: "buy"
}
]
I have tried
$json = json_decode($result);
echo $json[0]->price;
echo $json->[0]price;
echo $json->[0]->price;
Keep getting errors such as:
Fatal error: Cannot use object of type stdClass as array in
How can i acess each indivudal element with no array name? Thanks
$neededData = $myArray['']