2010-09-05 209 views
1

我需要一些嵌套數組按其鍵值按字母順序排序...php:按鍵排列多維數組?

是否有一個本地的PHP函數來排序如下這樣的嵌套數組是爲了像

[G] - >陣.. 。

[I] - >陣列...

[P] - >陣列...

[S] - >陣列...

[T] - >陣列...

這裏是一個例子排序的數組:

[S] => Array 
    (
     [26] => Array 
      (
       [name] => St Georges Hall 
       [tel] => sdfa 
      ) 

     [27] => Array 
      (
       [name] => St Werburghs Community Centre 
       [tel] => sadf 
      ) 
    ) 

[G] => Array 
    (
     [40] => Array 
      (
       [name] => The Golden Guinea 
       [tel] => 
      ) 

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

    ) 

[I] => Array 
    (
     [45] => Array 
      (
       [name] => The Island 
       [tel] => asdfgf 
      ) 

    ) 

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

    ) 

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

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

    ) 

回答