title: SimpleXML returning multiple objects, how can I get the data?
body: <p>I'm using simpleXML to parse <a href="http://gdata.youtube.com/feeds/api/videos?author=ofcoursegolf&amp;max-results=5&amp;prettyprint=true" rel="nofollow noreferrer">this xml file</a>. It's a feed I'm using to access the YouTube API. I want to embed the most recent video in an object and display the next four thumbnails.</p>
  
  <p>So I'm using <code>simplexml_load_file</code> on this, going using a <code>foreach</code> loop to access the values in each feed.</p>
  
  <p>I can access the values no problem, but I run into the problem that it stores each video in a separate <code>SimpleXMLElement Object</code>. I don't have any control over which object I'm accessing as they are not stored in an array. So I can't get, say, <code>$thumb[4]</code> or <code>$entry[4]-&gt;thumb</code>.</p>
  
  <p>I tried to use <code>SimpleXMLIterator</code>, but for whatever reason, any values that have the same beginning render as blank. For example, the video could have eleven variations of: </p>
  
  <p></p>
  
  <p>And these would each render as <code>[1]=""</code>, <code>[2]=""</code>, <code>[3]=""</code>, etc.</p>
  
  <p>I'll happily provide some more information to anyone who can help!</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Here is the print_r of my results. This is done on a single variable to give you an idea of the structure issue I'm facing. The entire print_r($entry) would give variables for each node in the XML file.</p>
  
  <pre><code>SimpleXMLElement Object
  (
      [0] =&gt; 159
  )
  SimpleXMLElement Object
  (
      [0] =&gt; 44
  )
  </code></pre>
  
  <p>Also, the print_r is simply inside the PHP block for testing. I'm actually looking to access the variables within echoes in the HTML.</p>