title: Sort php multidimensional array by sub-value
body: <p>I have this array</p>
  
  <pre><code>Array
  (
  [data] =&gt; Array
      (
          [0] =&gt; Array
              (
  
                  [id] =&gt; 1293005125
                  [viewed] =&gt; TRUE
                  [active] =&gt; TRUE
                  [time] =&gt; December 22, 2010 13:00 hours
                  [timestamp] =&gt; 1293006034
                  [initial_timestamp] =&gt; 1293005125
                  [user] =&gt; administrator
              )
  
          [1] =&gt; Array
              (
  
                  [mid] =&gt; 1293001908
                  [viewed] =&gt; TRUE
                  [active] =&gt; TRUE
                  [time] =&gt; December 22, 2010 13:00 hours
                  [timestamp] =&gt; 1293001908
                  [initial_timestamp] =&gt; 1293001908
                  [user] =&gt; administrator
              )
  
          [2] =&gt; Array
              (
  
                  [mid] =&gt; 1293009999
                  [viewed] =&gt; TRUE
                  [active] =&gt; TRUE
                  [time] =&gt; December 22, 2010 13:00 hours
                  [timestamp] =&gt; 1293009999
                  [initial_timestamp] =&gt; 1293009999
                  [user] =&gt; administrator
              )
  
          [3] =&gt; Array
              (
  
                  [mid] =&gt; 1293006666
                  [viewed] =&gt; TRUE
                  [active] =&gt; TRUE
                  [time] =&gt; December 22, 2010 13:00 hours
                  [timestamp] =&gt; 1293006666
                  [initial_timestamp] =&gt; 1293006666
                  [user] =&gt; administrator
              )
  
          [4] =&gt; Array
              (
  
                  [mid] =&gt; 1293005125
                  [viewed] =&gt; TRUE
                  [active] =&gt; TRUE
                  [time] =&gt; December 22, 2010 13:00 hours
                  [timestamp] =&gt; 1293006125
                  [initial_timestamp] =&gt; 1293005125
                  [user] =&gt; administrator2
              )
  
  
      )
  </code></pre>
  
  <p>Now I would like to sort this array by <code>[mid]</code>
  How do I do this?</p>
  
  <p>Currently I sort this in a foreach loop<br>
  There has to be a better way</p>
  
  <p><strong>EDIT</strong>
  I hoped to output something like</p>
  
  <p><code>[mid] key =&gt; array value</code></p>
  
  <p>Thanks</p>