title: PHP - How can I sort this multi dimensional array by sum value?
body: <p>How can I sort this array by the sum value of each set in the deepest nested array?</p>
  
  <pre><code>$arr = Array(
      Array(
          'I am the first string.',
          Array(
              Array( 'round', 1, 1 ),
              Array( 'rhythm', 1, 1 )
          )
      ),
      Array(
          'I am the second string',
          Array(
              Array( 'cps', 1, 1 ),
              Array( 'Hz', 1, 3 ),
              Array( 'hertz', 1, 1 )
          )
      ),
      Array(
          'I am the third string.',
          Array(
              Array( 'uucps', 1, 1 ),
              Array( 'uuHz', 1, 2 ),
              Array( 'uuhertz', 1, 1 )
          )
      )
  
  );
  </code></pre>
  
  <p>I need to sort the second dimension of arrays by the sum value of third key of the deepest set(third dimension). </p>
  
  <p>So the end result will look like this:</p>
  
  <pre><code>$arr = Array(
      Array(
          'I am the second string',
          Array(
              Array( 'cps', 1, 1 ),
              Array( 'Hz', 1, 3 ),
              Array( 'hertz', 1, 1 )
          )
      ),
      Array(
          'I am the third string.',
          Array(
              Array( 'uucps', 1, 1 ),
              Array( 'uuHz', 1, 2 ),
              Array( 'uuhertz', 1, 1 )
          )
      ),
      Array(
          'I am the first string.',
          Array(
              Array( 'round', 1, 1 ),
              Array( 'rhythm', 1, 1 )
          )
      )
  
  );
  </code></pre>
  
  <p>I know that usort might be my best bet but I can't seems to make it work for my use case.</p>