Jump to content

help in displaying data


bapi

Recommended Posts

hi,

 

i want to display some information in formate of 1 -> 3->9 .........

 

I have site in which in need to display list of people in chain. That mean that a person have chain of peoples below him. like

 

 

                1

        1      2        3

    1 2 3  1 2 3  1 2 3

 

.....................................

 

Now, how can i display all the members present below "1" in one page.

 

Any help will be great full

Link to comment
https://forums.phpfreaks.com/topic/75483-help-in-displaying-data/
Share on other sites

Try with recursion, for example

 

function display_childs($id)

{

    // here goes a function to get array and print all the childs of $id if it has childs, if it hasn't - return.

    // after that for every child of $id you call function display_childs()

 

//for example:

    foreach($childs as $key=>$value)

      function display_childs($value);

}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.