how to make php array tree recursion
Array
(
    [0] => Array
        (
            [0] => 1
            [id] => 1
            [1] => mobile
            [name] => mobile
            [2] => 
            [parent_id] => 
        )

    [1] => Array
        (
            [0] => 2
            [id] => 2
            [1] => car
            [name] => car
            [2] => 
            [parent_id] => 
        )

    [2] => Array
        (
            [0] => 3
            [id] => 3
            [1] => shirt
            [name] => shirt
            [2] => 
            [parent_id] => 
        )

    [3] => Array
        (
            [0] => 4
            [id] => 4
            [1] => tshirt
            [name] => tshirt
            [2] => 
            [parent_id] => 
        )

    [4] => Array
        (
            [0] => 5
            [id] => 5
            [1] => nokia
            [name] => nokia
            [2] => 1
            [parent_id] => 1
        )

    [5] => Array
        (
            [0] => 6
            [id] => 6
            [1] => samsung
            [name] => samsung
            [2] => 1
            [parent_id] => 1
        )

    [6] => Array
        (
            [0] => 7
            [id] => 7
            [1] => n95
            [name] => n95
            [2] => 5
            [parent_id] => 5
        )

    [7] => Array
        (
            [0] => 8
            [id] => 8
            [1] => lenova
            [name] => lenova
            [2] => 2
            [parent_id] => 2
        )

    [8] => Array
        (
            [0] => 9
            [id] => 9
            [1] => maruti
            [name] => maruti
            [2] => 2
            [parent_id] => 2
        )

    [9] => Array
        (
            [0] => 10
            [id] => 10
            [1] => secondhand
            [name] => secondhand
            [2] => 9
            [parent_id] => 9
        )

    [10] => Array
        (
            [0] => 11
            [id] => 11
            [1] => brandnew
            [name] => brandnew
            [2] => 9
            [parent_id] => 9
        )

    [11] => Array
        (
            [0] => 12
            [id] => 12
            [1] => n44
            [name] => n44
            [2] => 7
            [parent_id] => 7
        )

)


how to make above array nested tree recursion.
please expert people help me to solve this problem.
how to make php array tree recursion
===

Array
(
    [0] => Array
        (
            [0] => 1
            [id] => 1
            [1] => mobile
            [name] => mobile
            [2] => 
            [parent_id] => 
        )

    [1] => Array
        (
            [0] => 2
            [id] => 2
            [1] => car
            [name] => car
            [2] => 
            [parent_id] => 
        )

    [2] => Array
        (
            [0] => 3
            [id] => 3
            [1] => shirt
            [name] => shirt
            [2] => 
            [parent_id] => 
        )

    [3] => Array
        (
            [0] => 4
            [id] => 4
            [1] => tshirt
            [name] => tshirt
            [2] => 
            [parent_id] => 
        )

    [4] => Array
        (
            [0] => 5
            [id] => 5
            [1] => nokia
            [name] => nokia
            [2] => 1
            [parent_id] => 1
        )

    [5] => Array
        (
            [0] => 6
            [id] => 6
            [1] => samsung
            [name] => samsung
            [2] => 1
            [parent_id] => 1
        )

    [6] => Array
        (
            [0] => 7
            [id] => 7
            [1] => n95
            [name] => n95
            [2] => 5
            [parent_id] => 5
        )

    [7] => Array
        (
            [0] => 8
            [id] => 8
            [1] => lenova
            [name] => lenova
            [2] => 2
            [parent_id] => 2
        )

    [8] => Array
        (
            [0] => 9
            [id] => 9
            [1] => maruti
            [name] => maruti
            [2] => 2
            [parent_id] => 2
        )

    [9] => Array
        (
            [0] => 10
            [id] => 10
            [1] => secondhand
            [name] => secondhand
            [2] => 9
            [parent_id] => 9
        )

    [10] => Array
        (
            [0] => 11
            [id] => 11
            [1] => brandnew
            [name] => brandnew
            [2] => 9
            [parent_id] => 9
        )

    [11] => Array
        (
            [0] => 12
            [id] => 12
            [1] => n44
            [name] => n44
            [2] => 7
            [parent_id] => 7
        )

)


how to make above array nested tree recursion.
please expert people help me to solve this problem.