Problems reading an RSS feed with SimpleXML

c4c4

New Member
I am trying to read a simple Twitpic rss feed but not having much luck. I can't see anything wrong with my code, but its only returning the following when using print_r()\[code\]Array ( [title] => SimpleXMLElement Object ( ) )\[/code\]Here is my code:\[code\]function get_twitpics() { /* get raw feed */ $url = 'http://www.twitpic.com/photos/Shealan/feed.rss'; $raw = file_get_contents($url); $xml = new SimpleXmlElement($raw); /* create array from feed items */ foreach($xml->channel->item as $item) { $article = array(); $article['title'] = $item->description; } return $article;}\[/code\]
 
Back
Top