I am hopeing somebody can help me out with an RSS feed issue I am having, working locally, using XAMPP.
I am trying to display two RSS feeds on my website. One from BBC Education which works, and one from a Joomla site, which doesn't work.
The php code I am using is identical in both cases apart from the url, perhaps I have to change my php some way for each feed? The feeds are on the same page, although this shouldn't matter?
The (working) BBC feed is here
The php code I use to successfully display this feed is below;
<div class="panel-body">
    <?php
    $rss = new DOMDocument();
    $rss->load('http://feeds.bbci.co.uk/news/education/rss.xml?edition=uk');
    $feed = array();
    foreach ($rss->getElementsByTagName('item') as $node) {
    $item = array ( 
     'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
     'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
     'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
     );
    array_push($feed, $item);
    } 
    $limit = 3;
    for($x=0;$x<$limit;$x++) {
    $title = str_replace(' & ', ' & ', $feed[$x]['title']);
    $link = $feed[$x]['link'];
    $description = $feed[$x]['desc'];
    echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
    echo '<p>'.$description.'</p>';
    }  
    ?>
    </br>
    <a href="#" class="btn btn-default">Learn More</a>
</div>
The (not working) Joomla feed is here
The code I use to (unsuccessfully) display this feed is below;
<div class="panel-body">
    <?php
    $rss = new DOMDocument();
    $rss->load('http://www.littlehandssurestart.co.uk/blog?format=feed&type=rss');
    $feed = array();
    foreach ($rss->getElementsByTagName('item') as $node) {
    $item = array ( 
     'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,
     'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,
     'link' => $node->getElementsByTagName('link')->item(0)->nodeValue,
     );
    array_push($feed, $item);
    } 
    $limit = 3;
    for($x=0;$x<$limit;$x++) {
    $title = str_replace(' & ', ' & ', $feed[$x]['title']);
    $link = $feed[$x]['link'];
    $description = $feed[$x]['desc'];
    echo '<p><strong><a href="'.$link.'" title="'.$title.'">'.$title.'</a></strong><br />';
    echo '<p>'.$description.'</p>';
    }  
    ?>
    </br>
    <a href="#" class="btn btn-default">Learn More</a>
</div>
The error is receive regarding the Joomla feed above is as follows;
Warning: DOMDocument::load(): Empty string supplied as input in C:\xampp\htdocs\logintest\application\views\index\index.php on line 124
Notice: Undefined offset: 0 in C:\xampp\htdocs\logintest\application\views\index\index.php on line 136
Notice: Undefined offset: 0 in C:\xampp\htdocs\logintest\application\views\index\index.php on line 137
Notice: Undefined offset: 0 in C:\xampp\htdocs\logintest\application\views\index\index.php on line 138
I have read that this can be due to unclosed /> tags? However I can't find any. Quite new to php so any help is appreciated.
 
     
     
    