<?
$rss = simplexml_load_file($url);
if ($rss) {
foreach ($rss->channel->item as $str) {
echo '<p>".$str->title."</p>';
}
}
?>
I want to make output from end of RSS to beginning. How should I do this?
I assume that $rss
is an array, in that case you can use the array_reverse()
function :
foreach (array_reverse($rss->channel->item) as $str) {
echo '<p>'.$str->title.'</p>';
}