SimpleXML and accessing MediaRSS / other namespaces


print_r($xml->getDocNamespaces());

foreach ($xml->entry as $entry)
{

  //All the media namespaced items under an entry
  $media = $entry->children("http://search.yahoo.com/mrss/%27%29;"');
  echo "Title: " . $media->group->title;
  echo "Keywords: " . $media->group->keywords;

  //There are multiple thumbnail fields, so loop through and print out
  all the attributes
  foreach($media->group->thumbnail as $thumb)
  {
    foreach ($thumb->attributes() as $a => $b)
    {
      print $a . " " . $b . "\n";
    }
  }
}