title: read xml file from end to start in php
body: <p>i want to read xml file from end to start suppose my xml like that :</p>
  
  <pre><code>&lt;note&gt;
  &lt;to&gt;Tove&lt;/to&gt;
  &lt;from&gt;Jani&lt;/from&gt;
  &lt;heading&gt;Reminder&lt;/heading&gt;
  &lt;body&gt;Don't forget me this weekend!&lt;/body&gt;
  &lt;/note&gt;
  &lt;note&gt;
  &lt;to&gt;Samy&lt;/to&gt;
  &lt;from&gt;Jani&lt;/from&gt;
  &lt;heading&gt;Reminder&lt;/heading&gt;
  &lt;body&gt;Don't Miss me this weekend!&lt;/body&gt;
  &lt;/note&gt;
  </code></pre>
  
  <p>i need to read last note first i use code like that</p>
  
  <pre><code>$x = $xmldoc-&gt;getElementsByTagName('note');
          $nofnews = $xmldoc-&gt;getElementsByTagName('note')-&gt;length;
          for ($i = 0; $i &lt; $nofnews; $i++) {
              $item_title = $x-&gt;item($i)-&gt;getElementsByTagName('to')
                              -&gt;item(0)-&gt;nodeValue;
              $item_link = $x-&gt;item($i)-&gt;getElementsByTagName('from')
                              -&gt;item(0)-&gt;nodeValue;
                              }
  </code></pre>
  
  <p>thank you in advance</p>