Remove array "wrapping" (remove parent, keep children)

I have a problem, I would like to delete the contained array (key 80), but keep its children (with all keys and structure intact except the parent).

Can anyone help me

Array
(
    [80] => Array
        (
            [parent] => 0
            [lng] => en
            [children] => Array
                (
                    [98] => Array
                        (
                            [children] => Array
                                (
                                    [54] => Array
                                        (
                                            [parent] => 98
                                            [lng] => en
                                        )

                                )

                            [parent] => 80
                            [lng] => en
                        )

                )

        )

)

      

Thanks, BR

+2


source to share


2 answers


If you do:

$array=$array[80];

      



you keep the children and remove the parent

+3


source


Seems like all you need is



$children = $all[80];

      

+2


source







All Articles