cowboysdude Posted March 1, 2016 Share Posted March 1, 2016 Well I'm having a similar issue.. the following is only returning 2 results... there are many more..... cannot seem to figure out why... $feed = file_get_contents("http://www.dallascowboys.com/rss/video"); $xml = new SimpleXmlElement($feed); foreach ($xml->channel->item as $entry){ $date = $entry->pubDate; $title= $entry->title; $namespaces = $entry->getNameSpaces(true); $media = $entry->children($namespaces['media']); $date = $entry->pubDate; $title= $entry->title; $des= $entry->description; $link = $media->group->content[4]->attributes()->url; $thumb = $media->group->content[2]->thumbnail[3]->attributes()->url; Like I said this is returning 2 of the many possible results.... Anyone have any insight as to why? Thanks everyone!!! Quote Link to comment Share on other sites More sharing options...
Barand Posted March 1, 2016 Share Posted March 1, 2016 Turn error reporting on then the reason becomes obvious. $media->group->content doesn't exist for the third item Quote Link to comment Share on other sites More sharing options...
cowboysdude Posted March 1, 2016 Author Share Posted March 1, 2016 Appreciate the input! But I'm thinking they added this to separate the 'content' media: category So it won't go past the 4th one... so I have to figure out my way around that one. You can see it when you go here: http://codebeautify.org/ and input your xml... it gives you an html 'tree view'.... So another adventure... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.