title: How to to sort a XML feed with SimpleXML
body: <p>I have started to use the simplexml function that seems to work out better than the previous other parser that I have tried to use. I have got to the stage where I need to the sort the items 
  by transmissiondate - I tried using the uasort but does not make any changes the order of the items.</p>
  
  <p>also some times a programme is on more than once on the same day - would it be easier to sortby videoID can any help?</p>
  
  <p>this what the object looks like:</p>
  
  <pre><code>[0] =&gt; SimpleXMLElement Object
      (
          [VideoID] =&gt; 108059
          [Genre] =&gt; Music
          [ProgrammeName] =&gt; MTV
          [OriginalAiringDate] =&gt; 2009-11-10T19:22:24
          [TransmissionDate] =&gt; 2009-11-10T19:22:24
     )
  [1] =&gt; SimpleXMLElement Object
      (
          [VideoID] =&gt; 108395
          [ExpiryDate] =&gt; 2009-12-12T23:59:59
          [DateCreated] =&gt; 2009-11-12T13:28:54
          [Genre] =&gt; Music
          [ProgrammeName] =&gt; MTV
          [OriginalAiringDate] =&gt; 2009-11-12T19:22:32
          [TransmissionDate] =&gt; 2009-11-12T19:22:32
   )
  
  $xml = simplexml_load_file("data.xml");
  $count = 0;
  $sortItem = 0;
  $dateformat = "D j M, g:ia";
  $sortArray = array();
  foreach($xml-&gt;CatchUp as $item){
  $sortArray[$count][TransmissionDate] = $item;
  if($count &lt; 4){
  print "&lt;p&gt;Programme Name:&lt;strong&gt; "  . $item-&gt;ProgrammeName. "&lt;/strong&gt;&lt;/p&gt;";
  print "&lt;p&gt;Date Shown:&lt;strong&gt; "  . date($dateformat, strtotime($item-&gt;TransmissionDate)). "&lt;/strong&gt;&lt;/p&gt;";
  print "&lt;p&gt;Description:&lt;strong&gt; " . trunc($item-&gt;ShortSynopsis,30, " ")."&lt;/strong&gt;&lt;/p&gt;";
  print "&lt;p&gt;&lt;a href='". $item-&gt;VideoID. "'&gt;". $item-&gt;VideoID."&lt;/a&gt;&lt;/p&gt;";
           $count++;
    }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>asort($sortArray);</p>