I know that ksort()
is used to sort array by keys. The max dimension of my array always differs. Sometime 2, sometimes 5, sometime 10 dimensional so how do I use ksort()
to do sorting dynamically without knowing how many dimensions exist in it?
Thanks
EXAMPLE ARRAY
[2010] => Array
(
[3] => Array
(
[B] => Array
(
[6] => Array
(
[Patato] =>
)
[C] => Array
(
[Patato] =>
[Zozo] =>
)
)
[A] => Array
(
[F] => Array
(
[Tomato] =>
[Apple] =>
[Kiwi] =>
)
)
[1] => Array
(
[4] => Array
(
[A] => Array
(
[Orange] =>
)
)