[Solved] How to Parse JSON with PHP?
[ad_1] You need do it in following manner:- <?php $data=”{ “metrics”: { “timers”: [ { “name”: “com.android.timer.launchtime”, “startTime”: 1232138988989, “duration_ms”: 1900 }, { “name”: “com.android.timer.preroll-load-time”, “startTime”: 1232138988989, “duration_ms”: 1000 } ] } }”; $new_array = json_decode($data); //convert json data into array echo “<pre/>”;print_r($new_array); //print array foreach ($new_array->metrics->timers as $new_arr){ // iterate through array echo $new_arr->name.'<br/>’; … Read more