I do this and it works.
<?php
function load_file($url)
{
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$xml = simplexml_load_string(curl_exec($ch));
return $xml;
}
$feedurl = 'http://www.astrology.com/horoscopes/daily-extended.rss';
$rss = load_file($feedurl);
$items = array();
$count = 0;
foreach ($rss->channel->item->description as $i => $description)
{
$items[$count++] = $description;
}
echo $items[0];
?>
When I echo $items[1]; it doesn't show the next one in line. Not sure what I did wrong.
var_dump($items)see what it returns. And what is the xml format ?$rss->channel->iteminstead