I'm trying to get JSON data into my PHP script and the problem is that this is a nested JSON object with dynamically changed key value (I've converted JSON objects into PHP objects):
stdClass Object
(
[665261] => stdClass Object
(
[id] => 665261
[SpeiseplanName] => Campus Mensa Wismar
[Datum] => 2019-07-12
[KstNr] => 462
[ArtikelText] => ein Brathering ohne Mittelgräte
[ZusatzStoffe] => 9 Fi Gl
[ZusatzStoffeText] => mit Süßungsmittel, Fische, Gluten
[PeStud] => 0.75
[PeBed] => 1.35
[PeGast] => 1.75
[sortierung] => 46
)
[665262] => stdClass Object
(
[id] => 665262
[SpeiseplanName] => Campus Mensa Wismar
[Datum] => 2019-07-12
[KstNr] => 462
[ArtikelText] => zwei Bratheringe ohne Mittelgräte
[ZusatzStoffe] => 9 Fi Gl
[ZusatzStoffeText] => mit Süßungsmittel, Fische, Gluten
[PeStud] => 1.25
[PeBed] => 1.9
[PeGast] => 2.25
[sortierung] => 47
)
[665263] and so on.
So, I've already get the data like this:
<p id="desc"><?= htmlReady(_($data[665261]['ArtikelText'])) ?></p>
The output was then "zwei Bratheringe ohne Mittelgräte" as expected. But this numeric key 665261 is dynamic and changed every day.
So how can I access date with key's values like this? Thank you for your help.