我有一个多维相关数组,我尝试按字母顺序和按大小进行排序。检查我现在正在获取的例子,但现在我想按字母顺序排序键“ACC,ABB,AAB”,如果有意义的话,不用编辑大小排序。按字母顺序排列PHP关联数组并按大小排序
arsort($myarray);
// Returns an array sorted by its value size from biggest to smallest but need to to also sort it keys alpabetically without amongest keys that have the same size.
$myArray = Array ( <--- Arrange this alphabetically and by size
[AAA] => Array (is 1st
[1] => 1
[2] => 1
[3] => 1
[4] => 1
)
[ACC] => Array (should be 3rd
[1] => 1
[2] => 1
)
[ABB] => Array (should be 2nd
[1] => 1
[2] => 1
)
[AAB] => Array (should be 1st
[1] => 1
[2] => 1
)
[AA] => Array (is 1st
[1] => 1
)
[AB] => Array (is 2nd
[1] => 1
)
)
通过此链接http://stackoverflow.com/questions/4151155/sorting-a-multi-dimensional-array-by-the-size-of-its-sub-array按大小排序 – zamil