Php multilevel hierarchical array reading

i have a nested array generated by the custom php function . now i want to get facts data about that array. array is as below

> Array
> (
>     [9] => Array
>         (
>             [id] => 9
>             [name] => narayan ram
>             [gotra] => Rathore
>             [sex] => m
>             [dob] => 01-Jan-1917
>             [dod] => 03-Apr-1975
>             [idf] => 74
>             [idm] => 75
>             [status] => d
>             [image_profile] => m.png
>             [partnerid] => Array
>             (
>                 [0] => Array
>                     (
>                         [idw] => 8
>                         [name] => badali devi
>                         [gotra] => Rathore
>                         [dob] => 13-Mar-1942
>                         [dod] => 
>                         [marr_date] => 
>                         [marr_place] => Bargaon
>                         [idf] => 0
>                         [idm] => 0
>                         [status] => l
>                         [image_profile] => 8471522162748.jpg
>                     )
>             )
>         [children] => Array
>             (
>             )
>     )
> 
> [12] => Array
>     (
>         [id] => 12
>         [name] => Chhagan lal
>         [gotra] => Rathore
>         [sex] => m
>         [dob] => 01-Jan-1965
>         [dod] => 
>         [idf] => 9
>         [idm] => 8
>         [status] => l
>         [image_profile] => 3591522171025.jpg
>         [partnerid] => Array
>             (
>                 [0] => Array
>                     (
>                         [idw] => 13
>                         [name] => Gigi Devi
>                         [gotra] => Rathore
>                         [dob] => 01-Feb-1952
>                         [dod] => 
>                         [marr_date] => 
>                         [marr_place] => Mazal
>                         [idf] => 0
>                         [idm] => 0
>                         [status] => l
>                         [image_profile] => 6791522206348.jpg
>                     )
>             )
>         [children] => Array ( )
>     )
> [47] => Array
>     (
>         [id] => 47
>         [name] => jagdish kumar
>         [gotra] => Rathore
>         [sex] => m
>         [dob] => 07-Jun-1965
>         [dod] => 
>         [idf] => 9
>         [idm] => 8
>         [status] => l
>         [image_profile] => 5641522170091.jpg
>         [partnerid] => Array
>             (
>                 [0] => Array
>                     (
>                         [idw] => 48
>                         [name] => Shanti devi
>                         [gotra] => Rathore
>                         [dob] => 01-Jan-1971
>                         [dod] => 
>                         [marr_date] => 
>                         [marr_place] => samdari
>                         [idf] => 6556
>                         [idm] => 6557
>                         [status] => l
>                         [image_profile] => 7151522170110.jpg
>                     )
> 
>             )
>         [children] => Array
>             (
>             )
>     )
> [2657] => Array
>     (
>         [id] => 2657
>         [name] => ansi devi
>         [gotra] => Chouhan
>         [sex] => f
>         [dob] => 01-Jan-1968
>         [dod] => 
>         [idf] => 9
>         [idm] => 8
>         [status] => l
>         [image_profile] => 5721549207700.jpg
>         [partnerid] => Array
>             (
>                 [0] => Array
>                     (
>                         [idh] => 2656
>                         [name] => narsinga ram
>                         [gotra] => Chouhan
>                         [dob] => 01-Jan-1963
>                         [dod] => 
>                         [marr_date] => 
>                         [marr_place] => 
>                         [idf] => 5554
>                         [idm] => 5555
>                         [status] => l
>                         [image_profile] => 6761549207669.jpg
>                     )
>             )
>         [children] => Array ( )
>     )
> [2] => Array
>     (
>         [id] => 2
>         [name] => gulabchand
>         [gotra] => Rathore
>         [sex] => m
>         [dob] => 01-Sep-1970
>         [dod] => 
>         [idf] => 9
>         [idm] => 8
>         [status] => l
>         [image_profile] => 4721528484104.jpg
>         [partnerid] => Array
>             (
>                 [0] => Array
>                     (
>                         [idw] => 1
>                         [name] => pushpa
>                         [gotra] => Rathore
>                         [dob] => 17-Oct-1972
>                         [dod] => 
>                         [marr_date] => 24-Apr-1983
>                         [marr_place] => Samdari
>                         [idf] => 633
>                         [idm] => 779
>                         [status] => l
>                         [image_profile] => 8231529289344.jpg
>                     )
>             )
>         [children] => Array
>             (
>             )
>     )
> )

ps- here first node is parent and others are child
i am new and not have any idea how to create this type of fuction in php kindly help

and we need output like

01-Jan-1917  Birth
<blank date> Marriage
             spouse- badali rathore
             place - bargaon
01-Jan-1965  Birth of Son Chaganlal
<blank date> Marriage of son
             spouse- gigi devi rathore
             place - sindhari
07-Jun-1965  Birth of Son jagdish rathore
<blank date> Marriage of son
             spouse- shanti rathore
             place - samdari
01-Jan-1968  Birth of daughter ansi
<blank date> Marriage of daughter
             spouse- narsinga ram chouhan
             place - ummedabad
01-Sep-1970  Birth of son Gulab chand
03-Apr-1975  Death
24-Apr-1983  Marriage of son
             spouse- pushpa rathore
             place - jodhpur

Lets back up to this function. First, what is the source of the data? A Database? If so, post an SQL dump of your DB with a few sample records. Also post the custom function.

I don’t see any structure in this input/output, the string “Chaganlal” doesn’t even exists within the input.

Sponsor our Newsletter | Privacy Policy | Terms of Service