Parent, child JSON parsing in PHP? -
i have json file structure below:
{ "data": { "last_all": { "value": "1194999", "value_int": "2342", "display": "332", "disp1": "953.3", "current": "blr" }, "item": "nrf", "low": "494.55" } }
how go getting value "display" last_all?
this part stuck: print $obj['last_all']['display'];
cant pass more 3 params cant tell php under data last_all display.
simple oversight. you're missing 'data' in array reference:
$obj = json_decode($json_string, true); print $obj['data']['last_all']['display'];
Comments
Post a Comment