array_values ​​rekurencyjne php

Powiedzmy, że mam taką tablicę:

Array
(
    [id] => 45
    [name] => john
    [children] => Array
    (
        [45] => Array
            (
                [id] => 45
                [name] => steph
                [children] => Array
                    (
                        [56] => Array
                            (
                                [id] => 56
                                [name] => maria
                                [children] => Array
                                    (
                                        [60] => Array
                                            (
                                                [id] => 60
                                                [name] => thomas
                                            )

                                        [61] => Array
                                            (
                                                [id] => 61
                                                [name] => michelle
                                            )

                                    )
                            )

                        [57] => Array
                            (
                                [id] => 57
                                [name] => luis
                            )

                     )

            )

    )

)

Próbuję zresetować klucze tablicy za pomocą klawiszychildren do 0, 1, 2, 3 itd. zamiast 45, 56 lub 57.

Próbowałem czegoś takiego:

function array_values_recursive($arr)
{
    foreach ($arr as $key => $value)
    {
        if(is_array($value))
        {
            $arr[$key] = array_values($value);
            $this->array_values_recursive($value);
        }
    }

    return $arr;
}

Ale to resetuje tylko klucz pierwszej tablicy potomnej (klucz z kluczem 45)

questionAnswers(5)

yourAnswerToTheQuestion