Answer the question
In order to leave comments, you need to log in
php. How to display all item_news from rss feed?
There is a format feed.
<item>
<title>title sdfs </title>
<description>description text</description>
<link>site.com/1</link>
<item_news>
<item_news_title>text 1</item_news_title>
<item_news_description>description text 1</item_news_description>
<item_news_url>google.ru</item_news_url>
</item_news>
<item_news>
<item_news_title>text 2</item_news_title>
<item_news_description>description text 2</item_news_description>
<item_news_url>google.com</item_news_url>
</item_news>
</item>
<item>
<title>title sdfsdd </title>
<description>description text 2</description>
<link>site.ru/2</link>
<item_news>
<item_news_title>text 3</item_news_title>
<item_news_description>description text 3</item_news_description>
<item_news_url>google.de</item_news_url>
</item_news>
<item_news>
<item_news_title>text 4</item_news_title>
<item_news_description>description text 4</item_news_description>
<item_news_url>google.fr</item_news_url>
</item_news>
</item>
$i = 0;
foreach ($xml->channel->item as $item) {
if($i<5){
echo "<h3>". $item->title . "</h3>";
echo $item->link."<br/>";
echo $item->description."<br/>";
echo $item->item_news->item_news_title."<br/>";
}
$i++;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question