Let’s say we have an array like that
array(2) {
[2012]=>
array(2) {
[0]=>
array(2) {
["file"]=>
string(3) "aaa"
["mtime"]=>
int(1347534106)
}
[1]=>
array(2) {
["file"]=>
string(3) "bbb"
["mtime"]=>
int(1346293592)
}
}
[2011]=>
array(2) {
[0]=>
array(2) {
["file"]=>
string(3) "ccc"
["mtime"]=>
int(1316753224)
}
[1]=>
array(2) {
["file"]=>
string(3) "ddd"
["mtime"]=>
int(1318671936)
}
}
}
I want this array to be sorted descending by first index (2012,2011[,2010,…]) and every subarray (every value of the root array) sorted descending by mtime values, but I cannot get how to apply array_multisort() to this. I could pass first key as '2012' and then it would be passed as a key of an associative array, but how to sort by mtime then?