I have 2 images elements in an RSS and i’m struggling to target them.
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>RSS title</title>
<link>http://www.yoursite.com</link>
<description>description goes here</description>
<item>
<title>Title of post</title>
<ContentItem Href="http://feeds.yoursite.com/imgjpg0876a797099de1d7389127472a413e3aad741551.jpg">
<MediaType FormalName="Pictureport" />
<MimeType FormalName="image/jpg" />
<Property FormalName="caption" value="Image caption" />
</ContentItem>
<ContentItem Href="http://feeds.yoursite.com/imgjpg0876a797099de1d7389127472a413e3aad741551.jpg">
<MediaType FormalName="Pictureport" />
<MimeType FormalName="image/jpg" />
<Property FormalName="caption" value="Image caption" />
</ContentItem>
</item>
</channel>
</rss>
If i want to grab the title it’s simply
$RSS_DOC = simpleXML_load_file($feed_url);
$rss_title = $RSS_DOC->channel->item->title;
echo $rss_title
but how do i grab the image url? tried a couple of combinations but can’t put my finger on it. I need to grab both images into separate variables.