Jump to content

"foreach" problem


casper_1707

Recommended Posts

Hi!

I want to get news from a RSS. I get the news and i try to display them everyone in his own table.
[code]foreach ($rss->item as $item)
      {
echo "<table><tr><td><a href=$item->link>$item->title</a></td></tr>";
      echo "<tr><td>$item->description</td></tr></table>";
      }[/code] I don't know why, but insteed dispaying for every news a table, i get a table witch includes all the news.

My second problem is when i try to get the entire content of the news (wich results on the following of the link).
Let's say i have the following:
[code] <span class=arttitle>Romania sub ape,  episodul 2006</span><br /><span class=artdatetime>14 Aprilie 2006</span><br /><span class=arteditorname>Nicoleta Chiru, Miruna Olteanu</span>

<BR><BR>

<span class=artdescription>La un an de la inundatiile devastatoare, banatenii se lupta iarasi cu revarsarile raurilor.<br /></span></p><BR>
                                            <p><span class=artbody><p>Cele mai multe rauri din tara au depasit cel putin cotele de atentie, hidrologii avertizand ca zona Banatului este in continuare/span>[/code] The example is much longer but i posted just a fragment.
How i extract the text between tags?

Thanks!

PS: Sorry for my english.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.