The content
element has a namespace prefix (<media:content>
), so it can’t be accessed by the usual means.
Namespace-URI for "media" is from http://search.yahoo.com/mrss/
(check your rss.xml
for "xmlns:media").
Try this:
foreach ($xml->channel->item as $news)
{
$ns_media = $news->children('http://search.yahoo.com/mrss/');
echo $ns_media->content; // displays "<media:content>"
}
EDIT :
I think there is some prob with the namespace uri "http://search.yahoo.com/mrss/"
I tried using your xml :
http://codepad.org/P90bOQUj [not working]
I tried using other xml :
http://codepad.org/ADYveL6T [working]