Sign in to follow this  

Get (Namespaced?) value from RSS?

Recommended Posts

game_over    716

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.

Share this post


Link to post
Share on other sites
game_over    716

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]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.