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()
Array ( [title] => SimpleXMLElement Object ( ) )
Here is my 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;
}