Hallo, ich muss ein XML auslesen welches doppelte Feldnamen enthält:
Mich interessiert der Inhalt der Felder, die ich mit "Interessant" markiert habe.
Wie komme ich da dran?
Versucht habe ich schon:
Oder $anlage->text_modules->modul_text[1]
Ich komm bisher nicht drauf.
Code:
<?xml version="1.0" encoding="utf-8"?> <source> <anlagen> <anlage> <text_modules> <modul_header> Werbung </modul_header> <modul_text> Uninteressant </modul_text> </text_modules> <text_modules> <modul_header> Aufgaben </modul_header> <modul_text> Interessant </modul_text> </text_modules> <text_modules> <modul_header> Daten </modul_header> <modul_text> Interessant </modul_text> </text_modules> <text_modules> <modul_header> Angebot </modul_header> <modul_text> Interessant </modul_text> </text_modules> <text_modules> <modul_header> Bewertung </modul_header> <modul_text> Unteressant </modul_text> </text_modules> </anlage> <anlagen> <source>
Mich interessiert der Inhalt der Felder, die ich mit "Interessant" markiert habe.
Wie komme ich da dran?
Versucht habe ich schon:
Code:
foreach ($anlage->text_modules->modul_text as $inhalt) { echo $inhalt; }
Ich komm bisher nicht drauf.
Kommentar