title: ksort-ing an array of array using array_walk in PHP?
body: <p>How can apply <code>ksort</code> to each element of <code>$counts</code> array? I mean simply <strong>call this function on each nested array</strong>, not recursively. </p>
  
  <pre><code>bool array_walk(array &amp;$array, callable $funcname [,mixed $userdata = NULL])
  </code></pre>
  
  <p>I've tried <code>array_walk</code> passing the flag <code>SORT_NUMERIC</code> as user data. This gives me <strong>a warning</strong>:</p>
  
  <pre><code>    $counts = array();
  
      $counts['group1'] = array(); // Keys are timestamps but as STRING
      $counts['group2'] = array(); // Keys are timestamps but as STRING
      // ...
  
      // Array + operator does a key reordering here
      $counts['group1'] += $dummyData;
      $counts['group2'] += $dummyData;
  
      // .. so sort array by keys
      array_walk($counts, 'ksort', SORT_NUMERIC);
  </code></pre>
  
  <blockquote>
    <p>Warning: ksort() expects at most 2 parameters, 3 given.</p>
  </blockquote>
  
  <p>What's the <strong>third parameter</strong>?</p>
  
  <p><strong>EDIT</strong>: genius answer:</p>
  
  <pre><code>foreach($counts as &amp;$group) :
      ksort($group, SORT_NUMERIC);
  endforeach;
  </code></pre>