title: XML / Php Read XML, Parse, Output
body: <p>I am trying to pull data from a source, then parse the data for 3 different fields: "title", "link", "description" and then output the data. However, the loop appears to load the first 10 articles, but then turns into a <em>never ending loop</em> . How do I fix this?</p>
  
  <pre><code>&lt;?php
  
  #Load in File
  $xmlUrl ="http://sports.yahoo.com/mlb/rss.xml";
  $ConvertToXml = simplexml_load_file($xmlUrl);
  
  # -&gt; Setup XML
  $newsStory = $ConvertToXml-&gt;channel-&gt;item;
  
  # -----&gt; Load News Stories
  for($i = 0;i&lt;10; $i++){
  
      $title=$newsStory[$i]-&gt;title;
      //$link=$newsStory[$i]-&gt;link;
      $desc=$newsStory[$i]-&gt;description;
  
      echo '&lt;hr&gt;';
      echo 'Title:'.$title.'&lt;br /&gt;';
      //echo 'Link:'.$link.'&lt;br /&gt;';
      echo 'Description'.$desc.'&lt;br&gt;';
      echo '&lt;hr&gt;';
  
  }
  
  ?&gt;
  </code></pre>
  
  <p>The XML I'm parsing:
  <img src="https://i.stack.imgur.com/oIe7O.png" alt="img"></p>