i eine XML-Datei wie folgt hava:Schleife eine Schleife in einer XML-Datei?
<name>
<entry>
<date>2012-03-18 13:53:23</date>
<ID>1</ID>
<category>questions</category>
<question>who are you?</question>
<answers>
<answer text='a man' id='1'/>
<answer text='a woman' id='2'/>
<answer text='an animal' id='3'/>
<answer text='an alien' id='4'/>
</answers>
<author>Gorge</author>
</entry>
</name>
und ich versuche, alle Felder Schleife, aber wenn ich auf die Antwort Punkt dosent es Schleife alle Antworten
irgendwelche Tipps, wie kann ich das schaffen?
Ich verwende:
foreach($xml->entry as $entry){
echo "<p>";
echo "<strong>Author:</strong> ".$entry->author."<br/>";
echo "</p>";
}
Für das Ergebnis.
Thanx im Voraus Patrik
Wie Looping Sie die Felder? In Code? Mit XSLT? –
Gibt es eine 'foreach ($ entry-> answers-> answer als $ answer) irgendwo in deinem Code? – Tomalak