php: alphabetically sort multi-dimensional array by it's key?
<p>I need to sort some nested arrays alphabetically by their key...</p>

<p>Is there a native PHP function to sort the following so the nested arrays were in order like</p>

<p>[G] -> array...</p>

<p>[I] -> array...</p>

<p>[P] -> array...</p>

<p>[S] -> array...</p>

<p>[T] -> array...</p>

<p>here is an example unsorted array:</p>

<pre><code>[S] =&gt; Array
    (
        [26] =&gt; Array
            (
                [name] =&gt; St Georges Hall
                [tel] =&gt; sdfa
            )

        [27] =&gt; Array
            (
                [name] =&gt; St Werburghs Community Centre
                [tel] =&gt; sadf
            )
    )

[G] =&gt; Array
    (
        [40] =&gt; Array
            (
                [name] =&gt; The Golden Guinea
                [tel] =&gt; 
            )

        [41] =&gt; Array
            (
                [name] =&gt; The Golden Lion
                [tel] =&gt; One of Bristol's key live music pubs
            )

    )

[I] =&gt; Array
    (
        [45] =&gt; Array
            (
                [name] =&gt; The Island
                [tel] =&gt; asdfgf
            )

    )

[P] =&gt; Array
    (
        [50] =&gt; Array
            (
                [name] =&gt; The Prom
                [tel] =&gt; Reliable gig venue and blues hotspot on Gloucester road
            )

    )

[T] =&gt; Array
    (
        [51] =&gt; Array
            (
                [name] =&gt; The Thunderbolt
                [tel] =&gt; Small gig venue in Totterdown
            )

        [52] =&gt; Array
            (
                [name] =&gt; Tobacco Factory
                [tel] =&gt; A modern cafe-bar with regular live music.
            )

    )
</code></pre>
