• 0

Get (Namespaced?) value from RSS?


Question

How can i get the following data from a RSS feed with PHP media:link

<media:link>http://www.some-url.com/</media:link>[/CODE]

I'm using SimpleXML and can easily grab things like <title>Some title</title>

Current code

[CODE]
foreach($RSS_DOC->channel->item as $item) {
$title = $item->title;
}
[/CODE]

But not sure how to do it for items with a colon. it gives a fatal error.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Nevermind work it out, this always happens, i'll look for hours, give up and make a thread, work it out 5 minutes later..


$namespace = $item->getNameSpaces(true);
$media = $item->children($namespace['media']);
$link = $media->link;
[/CODE]

Link to comment
Share on other sites

This topic is now closed to further replies.