I have this xml
http://www.scorespro.com/rss/live-soccer.xml
the structure is this :
<rss>
<channel>
<item>
<title>
</title>
</item>
</channel>
</rss>
I want to get the information about the titles, so i'm trying to do this, but without success.
$xml = simplexml_load_file('http://www.scorespro.com/rss/live-soccer.xml');
foreach($xml->item as $item)
{
echo $item->title;
}
I already did print_r($xml) to see if is parsing correctly the url that i'm giving.
$xml
has root node, in this case <rss>
:
foreach($xml->channel->item as $item)
You can also use XPath to get the items:
$items = $result = $xml->xpath('/rss/channel/item');