title: Natural sort an associative array?
body: <p>Given an array of arrays, how would I natural sort the inner arrays based on their values?</p>
  
  <p>Example array:</p>
  
  <pre><code>array (size=2)
    0 =&gt; 
      array (size=1)
        'manager' =&gt; string 'Manager 1' (length=9)
    1 =&gt; 
      array (size=1)
        'manager' =&gt; string 'Manager 3' (length=9)
  </code></pre>
  
  <p>Another example array:</p>
  
  <pre><code>array (size=2)
    0 =&gt; 
      array (size=1)
        'month' =&gt; string 'June' (length=4)
    1 =&gt; 
      array (size=1)
        'month' =&gt; string 'January' (length=7)
  </code></pre>
  
  <p>My first idea was to just <code>natsort()</code> them, but that expects a normal array. The next idea was to use <code>array_multisort($array, SORT_NATURAL);</code>, but that didn't work due to the associative arrays.</p>
  
  <p>So, how could I sort the inner arrays in using natural sorting? Also, keeping array keys doesn't matter in this case.</p>
  
  <p>EDIT:</p>
  
  <p>Expected output of array 1 would be the same (since Manager 1 and Manager 3 are already in order):</p>
  
  <pre><code>array (size=2)
    0 =&gt; 
      array (size=1)
        'manager' =&gt; string 'Manager 1' (length=9)
    1 =&gt; 
      array (size=1)
        'manager' =&gt; string 'Manager 3' (length=9)
  </code></pre>
  
  <p>Expected output of array two would put January ahead of June (the 'natural' order):</p>
  
  <pre><code>// 0 and 1 keys can switch or stay the same, doesn't matter
  array (size=2)
    0 =&gt; 
      array (size=1)
        'month' =&gt; string 'January' (length=4)
    1 =&gt; 
      array (size=1)
        'month' =&gt; string 'June' (length=7)
  </code></pre>