mam mały problem, a mianowicie
pobieram sobie kanał RSS o budowie:
Kod
<?xml version="1.0" encoding="iso-8859-1" ?>
- <rss version="2.0">
- <channel>
<title>DS</title>
<description>Latest from D-S</description>
<link>http://forums./index.php</link>
<pubDate>Fri, 12 Sep 2008 11:34:28 -0400</pubDate>
<ttl>1440</ttl>
- <item>
<title>The </title>
<link>http://forums./index.php?showtopic=2991</link>
- <description>
- <![CDATA[ Sorry ]]>
</description>
<pubDate>Sun, 09 Dec 2007 19:13:48 -0500</pubDate>
<guid>http://forums./index.php?showtopic=2991</guid>
</item>
....
- <rss version="2.0">
- <channel>
<title>DS</title>
<description>Latest from D-S</description>
<link>http://forums./index.php</link>
<pubDate>Fri, 12 Sep 2008 11:34:28 -0400</pubDate>
<ttl>1440</ttl>
- <item>
<title>The </title>
<link>http://forums./index.php?showtopic=2991</link>
- <description>
- <![CDATA[ Sorry ]]>
</description>
<pubDate>Sun, 09 Dec 2007 19:13:48 -0500</pubDate>
<guid>http://forums./index.php?showtopic=2991</guid>
</item>
....
i pobieram to tak:
<?php $simleXMLObject = simplexml_load_file('ht://forums./index.php?act=rssout&id=1'); foreach($simpleXMLObject->channel->item as $item) { } ?>
jednakżę mam cały czas PHP Warning: Invalid argument supplied for foreach() in test.php on line 6
jak powinienem pobierać tego RSS'a aby poprawienie pobierać title z item'a