Read JSON Data Using PHP [duplicate]

Use $obj = json_decode($yourJSONString); to convert it to an object.

Then use foreach($obj->response->docs as $doc) to iterate over the “docs”.

You can then access the fields using $doc->student_id and $doc->student_name[0].

Leave a Comment