title: Sorting objects in array by highest value
body: <p>I have a foreach loop which finds comment replies and stores them in <code>$child_comments</code> </p>
  
  <p>After </p>
  
  <pre><code>&lt;?php  echo '&lt;pre&gt;';
  print_r($child_comments);
  echo '&lt;/pre&gt;'; ?&gt;
  </code></pre>
  
  <p>I get a separate array for each of the parent comments:</p>
  
  <pre><code>Array
  (
      [0] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 603
              [comment_parent] =&gt; 600
              [user_id] =&gt; 2
          )
  
      [1] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 601
              [comment_parent] =&gt; 600
              [user_id] =&gt; 2
          )
  
  )
  
  Array
  (
       [0] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 584
              [comment_parent] =&gt; 580
              [user_id] =&gt; 1
          )
  )
  
  Array
  (
      [0] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 608
              [comment_parent] =&gt; 520
              [user_id] =&gt; 2
          )
  
      [1] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 598
              [comment_parent] =&gt; 520
              [user_id] =&gt; 2
          )
  
      [2] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 521
              [comment_parent] =&gt; 520
              [user_id] =&gt; 2
          )
  
  )
  </code></pre>
  
  <p>But I need to sort and output the comments by their comment id, from highest ID to lowest ID.</p>
  
  <p>I can get the comments I like with</p>
  
  <pre><code>foreach ($child_comments as $objects) {
    echo $objects-&gt;comment_ID;
  }
  </code></pre>
  
  <p>but still they will be sorted by their parent comments. Any ideas? The ideal structure would be something like this:</p>
  
  <pre><code>Array
  (
      [0] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 608
              [comment_parent] =&gt; 520
              [user_id] =&gt; 2
          )
      [1] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 603
              [comment_parent] =&gt; 600
              [user_id] =&gt; 2
          )
  
      [2] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 601
              [comment_parent] =&gt; 600
              [user_id] =&gt; 2
          )
  
      [3] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 598
              [comment_parent] =&gt; 520
              [user_id] =&gt; 2
          )
  
      [4] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 584
              [comment_parent] =&gt; 580
              [user_id] =&gt; 1
          )
  
      [5] =&gt; stdClass Object
          (
              [comment_ID] =&gt; 521
              [comment_parent] =&gt; 520
              [user_id] =&gt; 2
          )
  )
  </code></pre>