I have a multidimensional array like below(figure 1). I just want to push all the sub array keys which are equal to parent array key as key values.
As an example lets say, parent key is 23. and 23 has a child key 24. child key 24 has sub child keys (25,26,27....) and also sub child key may have another child keys. So what I want is to push all the child, subchild, subsubchild... to parent key 23. See figure 2.
I really appreciate if someone can come up with a solution for this.
Thanks a lot..
Figure 1
Array ( [
18] => Array (
[1] =>
[14] =>
)
[23] => Array (
[24] =>
)
[24] => Array (
[25] =>
[26] =>
)
[26] => Array (
[27] =>
[28] =>
)
)
Figure 2
Array ( [
18] => Array (
[1] =>
[14] =>
)
[23] => Array (
[24] => Array (
[25] =>
[26] => Array (
[27] =>
[28] =>
)
)
)
)