Forum Moderators: coopster
Code:
<?php
error_reporting(E_ALL);
require_once "/...path-to-pear.../pear/PEAR/XML/RSS.php";
$rss =& new XML_RSS("http://www.rte.ie/rss/gaa.xml");
$rss->parse();
// print headlines
print_r($rss->getItems());
echo "<ul>\n";
foreach ($rss->getItems() as $item) {
echo "<li><a href=\"" . $item['link'] . "\">" . $item['title'] . "</a></li>\n";
}
echo "</ul>\n";
?>
However, when i "include" this script into a page within a folder, it doesn't work. Printing the parsed feed simply shows a blank array. Any ideas why this would work in the root directory but not in a folder?
require_once "/...path-to-pear.../pear/PEAR/XML/RSS.php";
Make sure this is the correct path. That is the only thing that I can see going wrong here. Fix that path because that's probably where the error lies.