Har*_*ldo 1 php arrays sorting
我需要按键按字母顺序排序一些嵌套数组...
是否有一个本机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.
)
)
Run Code Online (Sandbox Code Playgroud)