I am trying to decode a JSON string into an array but i get the following error.
Fatal error: Cannot use object of type stdClass as array in C:\\w
Try like this:
$json_string = 'https://example.com/jsondata.json'; $jsondata = file_get_contents($json_string); $obj = json_decode($jsondata); print_r($obj->Result); foreach($obj->Result as $value){ echo $value->id; //change accordingly }