How would you sort an multidimensional array where the keys are randomly defined and not consistent?
The screenshot here shows the Year, then the months. Id like to have the months order in ascending order.
Everything Ive found on stack overflow and google shows methods like array_multisort (array_column($array, 'key'), SORT_DESC, $array);
which is seems to me that its only applicable if you know what your keys are going to be. In my case I don't, it could be 1 month, or 12 and they'll be in random order.
Same thing with other methods as
usort($table, function($a, $b) use ($column) {
return $a[$column] <=> $b[$column];
});
Any help to better understand would be greatly appreciative as a good learning experience.
End desired result