- var_dump: documentation ( source)
- json_decode: documentation ( source)
- preg_replace: documentation ( source)
<?php
$str = ' [
{
timestamp: 1509523044,
tid: 83450451,
price: "6381.0",
amount: "1.0",
type: "sell"
},
{
timestamp: 1509523044,
tid: 83450448,
price: "6380.0",
amount: "1.12894377",
type: "buy"
}
]';
$json = json_decode(preg_replace('/(\w+):/', '"$1":', $str));
Echo $json[0]->price;
Var_dump($json);