title: Reverse order of XML using PHP
body: <p>I'm using PHP to output data from an XML file. It's defaulting to chronological order, which I'd like to reverse. Is this possible with PHP? If so, how?</p>
  
  <p>Here's my <a href="http://bit.ly/j2n0m4" rel="nofollow">page</a> and code:</p>
  
  <pre><code>    $file = 'http://www.gostanford.com/data/xml/events/m-baskbl/2010/index.xml';
      $xml = simplexml_load_file($file);
  
          foreach ($xml as $event_date) {
          if(!empty($event_date-&gt;event['vn']) &amp;&amp; !empty($event_date-&gt;event['hn']) &amp;&amp; !empty($event_date-&gt;event['vs']) &amp;&amp; !empty($event_date-&gt;event['hs']))
          { 
              echo '&lt;li&gt;';
                  echo '&lt;h3&gt;', $event_date-&gt;event['vn'], ' vs ', $event_date-&gt;event['hn'], '&lt;/h3&gt;';
                  echo '&lt;p&gt;&lt;strong&gt;', $event_date-&gt;event['vs'], ' - ', $event_date-&gt;event['hs'], '&lt;/strong&gt;&lt;/p&gt;';
                  echo '&lt;p&gt;', date('F j, Y', strtotime($event_date['date'])), '&lt;/p&gt;';
              echo '&lt;/li&gt;';   
          }
      }
  </code></pre>
  
  <p>Thanks for your help!</p>