I need to read the file below:
string '{"object":"list","hasMore":true,"limit":10,"offset":0,"data":[{"city":{"object":"city","id":15873,"ibgeCode":"3550308","name":"São Paulo","districtCode":"00","district":"São Paulo","state":"SP"}},{"city":{"object":"city","id":15718,"ibgeCode":"5200050","name":"Abadia de Goiás","districtCode":"05","district":"Abadia de Goiás","state":"GO"}},{"city":{"object":"city","id":9853,"ibgeCode":"3100104","name":"Abadia dos Dourados","districtCode":"05","district":"Abadia dos Dourados","state":"MG"}},{"city":{"obj'... (length=1415)
I tried all the examples I found, but none helped me. The last one I tested was:
foreach($obj->data->city as $sthudent_o)
{
echo $sthudent_o;
echo $sthudent_o->id. " name is ".$sthudent_o->name[0];
echo "<br>";
}
If anyone can help me, thank you!