我有以下陣列:如何在PHP中通過鍵對關聯多維數組進行排序?
$data['uploads']['ccc'] = 'something';
$data['uploads']['bbb'] = 'something';
$data['uploads']['aaa'] = 'something';
$data['downloads']['ccc'] = 'something';
$data['downloads']['aaa'] = 'something';
$data['downloads']['bbb'] = 'something';
,我需要它的字母順序對關鍵字排序,所以最終結果必須是:
$data['downloads']['aaa'] = 'something';
$data['downloads']['bbb'] = 'something';
$data['downloads']['ccc'] = 'something';
$data['uploads']['aaa'] = 'something';
$data['uploads']['bbb'] = 'something';
$data['uploads']['ccc'] = 'something';
各種自定義排序功能,沒有運氣。任何想法嘗試?
的可能重複[PHP關聯數組排序(http://stackoverflow.com/questions/2957587/php-associative-array-sort) –