<?php
$val = $_GET["val"];
$url = "http://feeds.bbci.co.uk/news/rss.xml";
$xml = simplexml_load_file($url);
for($i = 0; $i < 10 ; $i++){
$title = $xml->channel->item[$i]->title;
$link = $xml->channel->item[$i]->link;
$description = $xml->channel->item[$i]->description;
$pubDate = $xml->channel->item[$i]->pubDate;
$rss .= "<a href='$link'><h3>$title</h3></a>";
$rss .= "$description";
$rss .= "<br />$pubDate<hr />";
}
echo $rss;
?>
Hello everyone! I have a problem here. I would like to list all the results for the rss link but it gets only 10. I know that I have the second condition for "for loop" as $i<10, but how can I remove that condition, and get all the results from the rss link?