title: How do I sort a multi-dimensional array by value?
body: <p>I have an array as following and I want to order that array by the value of the key "attack". First keys of the arrays <code>(15, 13, 18)</code> are ID of some certain item from database, so I don't want these keys to be changed when the array is sorted. Any help would be greatly appreciated.</p>
  
  <p>This is the array:</p>
  
  <pre><code>$data = array(
      '15' =&gt; array(
          'attack' =&gt; '45', 'defence' =&gt; '15', 'total' =&gt; '10'
      ),
      '13' =&gt; array(
          'attack' =&gt; '25', 'defence' =&gt; '15', 'total' =&gt; '10'
      ),
      '18' =&gt; array(
          'attack' =&gt; '35', 'defence' =&gt; '15', 'total' =&gt; '10'
      )
  );
  </code></pre>