title: PHP Sort Multidimensional Array Based on Multiple Criteria
body: <p>I have a multidimensional array that looks like:</p>
  
  <pre><code>$arr=Array
  (
      [0] =&gt; Array
          (
              [0] =&gt; TEAM1
              [1] =&gt; 3
              [2] =&gt; 0
              [3] =&gt; 422.47
              [4] =&gt; 192.62
          )
  
      [1] =&gt; Array
          (
              [0] =&gt; TEAM2
              [1] =&gt; 2
              [2] =&gt; 1
              [3] =&gt; 402.14
              [4] =&gt; 210.70
          )
  
      [2] =&gt; Array
          (
              [0] =&gt; TEAM3
              [1] =&gt; 3
              [2] =&gt; 0
              [3] =&gt; 376.79
              [4] =&gt; 174.64
          )
  )
  </code></pre>
  
  <p>The 5 columns relate to Team Name, # wins, # losses, # of points for, # of points against.</p>
  
  <p>How would I sort <code>$arr</code> by column 1 (# Wins) (Descending), then column 2 (# Losses) (Ascending), and then column 3 (# of Pts For) (Descending)</p>