I have an API which is returning some nested JSON data with multiple levels. My PHP code to loop through is below but I'm not getting any output:
$data = json_decode($output, true);
foreach($data as $item){
$title = $item->events->name->text;
echo $title;
}
An example of the data can be found here: https://i.sstatic.net/eAtrI.png
I am trying to print the text name of each of the events (events->name->text)
foreach($data->events as $item){foreach($data['events'] as $item)