Hello. I'm simulating a tree using the GD library. The tree will have 2 branches on each node. I've come to a problem. I'm using arrays within arrays within arrays of coordinates. I want to insert the new arrays into the very last set of arrays.

I can *get* to the last arrays using array_walk_recursive and do all the necessary calculations but i can't retrieve the path ($v[0][1][2]) to insert the new arrays.

This is what my array will look like roughly. An array with 2 arrays in with 2 arrays in each of those etc.

Code:
Array
(
    [0] => a
    [1] => b
    [2] => Array
        (
            [0] => c
            [1] => d
            [2] => Array
                (
                    [0] => g
                    [1] => h
                )

            [3] => Array
                (
                    [0] => i
                    [1] => j
                )

        )

    [3] => Array
        (
            [0] => e
            [1] => f
            [2] => Array
                (
                    [0] => k
                    [1] => l
                )

            [3] => Array
                (
                    [0] => m
                    [1] => n
                )

        )

)