在php中使用键值对多维数组排序

在php中使用键值对多维数组排序,php,arrays,sorting,Php,Arrays,Sorting,我想用php对下面的数组进行排序。数组应按服务[0][1]的值排序 Array ( [Services] => Array ( [0] => Travel & Hotels ~72 [1] => Automotive~119 [3] => Professional Services~71 [4] => Home Services~70 [6] => IT Serv

我想用php对下面的数组进行排序。数组应按服务[0][1]的值排序

Array
(
[Services] => Array
    (
        [0] => Travel & Hotels  ~72
        [1] => Automotive~119
        [3] => Professional Services~71
        [4] => Home Services~70
        [6] => IT Services & Computer Repair~83
        [8] => Health and Medical~69
    )

[Restaurants] => Array
    (
        [0] => American / Eclectic~2
        [1] => Cafe~11
        [2] => Desserts & Bakery~111
    )

[Shopping] => Array
    (
        [0] => Office Equipment~103
        [3] => Department Stores~91
        [15] => Cosmetics & Beauty Supply~90
        [16] => Musical Instruments & Teachers~102
        [17] => Food~87
    )

[Entertainment] => Array
    (
        [0] => Bars/Pubs~48
    )

[Travel] => Array
    (
        [0] => Hotels~129
    )
)

这样做应该很简单(假设
$attractionArray
是上面给出的外部数组):


我是新来的,你能帮我一下吗?我尝试了usort,但它不起作用。如果你尝试过,请展示你的方法。我正在将此数组存储在$temp中。所以我试着像usort($temp);我对此一无所知,请帮助我这里可能也回答了类似的问题:您能否解释一下“数组应按服务[0][1]的价值排序…”的确切含义?非常感谢,它工作得非常完美
foreach($attractionsArray as $key => $innerArray)
{
    sort($innerArray, SORT_STRING);
    $attractionArray[$key] = $innerArray;
}