I have an xml file, and I would like to bring to the page only one item of this file, in case I can bring all the items of one only through the code
<?php
$feed = file_get_contents('https://brasil.elpais.com/rss/brasil/portada_completo.xml');
$rss = new SimpleXmlElement($feed);
//echo "<pre>"; print_r($rss);
foreach($rss->channel->item as $noticia) {
echo '<p><a href="'.$noticia->link.'" title="'. $noticia->title .'">'.$noticia->title.''.$noticia->description.'</a></p>';
}
?>
In case I do not want to display all the items, I want only a specific part of the XML, which is in the middle of the generated array, the print of the generated array is this:
In case I want to bring the array [item] [6], only I am not able to do this location, and I would also like to ask some way to integrate xmls, in case I have more than 1 would like to interleave the page tags. If you can help me, I'm grateful.
In the case show the first item tag of the first xml file, then show the first item tag of the second xml file, dps show the fourth item tag of the first xml file, and so on.