2010-09-05 2 views
1

je dois trier des tableaux imbriqués dans l'ordre alphabétique par leur clé ...php: trier alphabétiquement tableau multi-dimensionnel par sa clé?

Y at-il une fonction PHP natif pour trier les suivants pour que les tableaux imbriqués étaient en ordre comme

[G] -> array .. .

[I] -> array ...

[P] -> array ...

[S] -> array ...

[T] -> array ...

est ici un exemple tableau non trié:

[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. 
      ) 

    ) 

Répondre

Questions connexes