4
Situation
I own 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
Wish to leave it so :
Array
(
[tb_agenda] => Array(
[tb_agenda_fase] => Array(
[tb_agenda_hora] => Array()
),
[tb_prospeccao] => Array()
)
)
I mean, my key order tree is the order of the keys of the array.
Someone knows how to implement this?
Related, but you will need to do this for each level of your structure.
– user25930
And how do you intend to maintain the values? Aiming that now everything will be nestled and arrays.
– Patrick Maciel
@Patrickmaciel, values are not important can be lost, serve only as an ordination helper. Ex.: a
chavethat has asvalue = nullis the father of all, thechave = 1is the daughter of the former and so on.– Guilherme Lautert