Need help with foreach and XML
Posted
by danit
on Stack Overflow
See other posts from Stack Overflow
or by danit
Published on 2010-04-01T09:09:27Z
Indexed on
2010/04/01
9:13 UTC
Read the original article
Hit count: 335
php
I have the following output (via link) which displays the var_dump of some XML im generating:
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.
© Stack Overflow or respective owner