I have a question So I have this array :
Array
(
[2016] => Array
(
[23] => Array
(
[total_auctions] => 0
[total_price] => 0
)
[22] => Array
(
[total_auctions] => 0
[total_price] => 0
)
[21] => Array
(
[total_auctions] => 0
[total_price] => 0
)
[20] => Array
(
[total_auctions] => 0
[total_price] => 0
)
)
I want to sort recursive by key. So I create the methode :
public function sortNestedArrayAssoc($a)
{
if (!is_array($a)) {
return false;
}
ksort($a);
foreach ($a as $k=>$v) {
$this->sortNestedArrayAssoc($a[$k]);
}
return true;
}
But I get the same result, the array with the key 23
is the first and I don' really understand where is the problem. Can you help me please ? Thx in advance and sorry for my english