Hello!
I have array:
Array
(
[list] => Array
(
[0] => Array
(
[transaction_list] => Array
(
[0] => Array
(
[category] => Array
(
[hierarchy] => Array
(
[0] => Array
(
[id] => 2
[title] => some title
)
)
)
)
[2] => Array
(
[category] => Array
(
[hierarchy] => Array
(
[0] => Array
(
[id] => 1
[title] => some title
)
[1] => Array
(
[id] => 11
[title] => some title
)
)
)
)
[3] => Array
(
[category] => Array
(
[hierarchy] => Array
(
[0] => Array
(
[id] => 2
[title] => some title
)
[1] => Array
(
[id] => 12
[title] => some title
)
)
)
)
)
)
)
)
I need to sort it by first id
in hierarchy
so the output be:
Array
(
[list] => Array
(
[0] => Array
(
[transaction_list] => Array
(
[1] => Array
(
[category] => Array
(
[hierarchy] => Array
(
[0] => Array
(
[id] => 1
[title] => some title
)
[1] => Array
(
[id] => 11
[title] => some title
)
)
)
)
[2] => Array
(
[category] => Array
(
[hierarchy] => Array
(
[0] => Array
(
[id] => 2
[title] => some title
)
)
)
)
[3] => Array
(
[category] => Array
(
[hierarchy] => Array
(
[0] => Array
(
[id] => 2
[title] => some title
)
[1] => Array
(
[id] => 12
[title] => some title
)
)
)
)
)
)
)
)
I have tried usort, ausort, ksort some custom methods found in online. … But nothing
How to achieve this?