I have some data out of a soap api. This data comes in this format:
array(2) { ["Request"]=> object(stdClass)#7 (3) { ["AccessKey"]=> string(3) "dub" ["Timestamp"]=> string(19) "2019.07.04 09:06:19" ["Conditions"]=> object(stdClass)#8 (1) { ["Condition"]=> object(stdClass)#9 (2) { ["Field"]=> string(11) "From" ["Value"]=> string(10) "1562223979" } } } ["Products"]=> object(stdClass)#10 (1) { ["Product"]=> array(10) { [0]=> object(stdClass)#11 (11) { ["Ean"]=> string(13) "4029759107323" ["Type"]=> string(9) "DVD" ["Title"]=> string(58) "Hellraisers" ["FSK"]=> string(36) "Freigegeben ohne Altersbeschränkung" ["Genre"]=> string(5) "Sport" ["Year"]=> string(4) "2015" ["Length"]=> string(3) "275" ["Language"]=> string(7) "Deutsch" ["Items"]=> string(1) "2" ["Release"]=> string(10) "2049-12-31" ["Label"]=> string(17) "Edel Germany GmbH" } I want to loop through this data and get the title of every set.
I tried a foreach loop, but I get some error messages.
foreach ($results as $result) { echo "Titel " . $result->Titel; } foreach ($results as $result) { echo "Titel " . $result['Product']->Titel; } Nothing works. I can't wrap my head around arrays...
Titelyou meanTitle? As you desire output for that example will be "Hellraisers"?foreach ($results['Products'] as $result) {in your last effort. (along with the correct spelling).