Need help with foreach and XML
- by danit
I have the following output (via link) which displays the var_dump of some XML im generating:
http://bit.ly/aoA3qY
At the very bottom of the page you will see some output, generated by this code:
foreach ($xml->feed as $entry) {
$title = $entry->title;
$title2 = $entry->entry->title;
}
echo $title;
echo $title2;
For some reason $title2 only outputs once, where there are multiple entries?
Im using $xml = simplexml_load_string($data); to create the xml.