I have the following php code to fetch the news feed from a particular site:
<?php
$rss = new DOMDocument();
$rss->load('http://feeds.jn.pt/JN-ULTIMAS');
$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,
'date' => $node->getElementsByTagName('pubDate')->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'];
$date = date('l F d, Y', strtotime($feed[$x]['date']));
echo '<ul id="tips"><li id="fontemaispequena">'.$title.'<li id="fontepequena">'.$description.'</li></ul>';
}
?>
I wanted to show you all the news just showing me one at a time doing a fade in and a fade out with jquery, at the moment you are showing me a list with the 3 news.
echo '<ul id="tips"><li id="fontemaispequena">'.$title.'<li id="fontepequena">'.$description.'</li></ul>';