Jump to content

Looping problem


cowboysdude

Recommended Posts

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!!! :)

Link to comment
Share on other sites

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... :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.