Hi all,
I am trying to get an image from an rss feed - should be simple but no. Here is some code that I have tried so far:
Base code to get rss feed:
$RSSitem = $RSS_DOC->channel->item[0];
$item_id = md5($RSSitem->title);
$fetch_date = date("Y-m-j G:i:s"); //NOTE: we don't use a DB SQL function so its database independant
$item_title = $RSSitem->title;
$item_description = $RSSitem->description;
$item_date = date("Y-m-j G:i:s", strtotime($RSSitem->pubDate));
$item_url = $RSSitem->link;
//This causes the following error when I echo $item_image: Call to a member function attributes() on a non-object
$item_image = $RSS_DOC->channel->item->ContentItem[0]->attributes()->Href;
//This displays nothing:
$item_image = $RSSitem->image;
Any ideas?
Thanks,
G