Sort a multidimensional array and retain its keys
<p>I currently use a usort with a custom function to sort a multidimensionial array:</p>

<pre><code>usort($arr, function($a, $b) {
    return $a['count'] - $b['count'];
});
</code></pre>

<p>This will sort the array fine, but it looses the key information.  Given the array:</p>

<pre><code>Array
(
    [3] =&gt; Array
        (
            [foo] =&gt; bar
            [count] =&gt; 11
        )

    [7] =&gt; Array
        (
            [foo] =&gt; baz
            [count] =&gt; 1
        )
)
</code></pre>

<p><code>usort</code> will produce:</p>

<pre><code>Array
(
    [0] =&gt; Array
        (
            [foo] =&gt; baz
            [count] =&gt; 1
        )

    [1] =&gt; Array
        (
            [foo] =&gt; bar
            [count] =&gt; 11
        )
)
</code></pre>

<p>I would like to sort by <code>count</code>, but retain the keys <code>[3]</code> and <code>[7]</code>.  Unfortunately <code>usort</code> will set the keys to <code>[0]</code> and <code>[1]</code>.</p>
