Situation
I have an array as follows:
Array
(
[1] => Array
(
[tree] => Array
(
[tb_agenda_hora] => 2,
[tb_agenda_fase] => 1,
[tb_agenda] => null
)
)
[2] => Array
(
[tree] => Array
(
[tb_prospeccao] => 1,
[tb_agenda] => null
)
)
)
Need
Do you want to leave it like this:
Array
(
[tb_agenda] => Array(
[tb_agenda_fase] => Array(
[tb_agenda_hora] => Array()
),
[tb_prospeccao] => Array()
)
)
That is, my order of the key tree
is the order of the keys of array
.
Does anyone know how to implement this?