Sunday, 1 September 2013

Recursion formatting php node->child->child level

Recursion formatting php node->child->child level

After a day of trying to solve this problem, I have to admit defeat.
Need to format a hierarchy it into a report/csv, where it is
indented/hierarchy properly, I need a php function that takes the array,
and creates the hierarchy as below. I know that the start node is "Sales";
//[so] [activity] [milestone] [compleated]
array(
array("Sales", "Motor", "Documentation", "10%"),
array("Sales", "Motor", "Communication", "15%"),
array("Sales", "Motor", "Metro file", "30%"),
array("Sales", "Motor", "Training", "33%"),
array("Sales", "Motor", "Client Services", "23%"),
array("Motor", "Documentation", "Doc revamp", "42%"),
array("Motor", "Documentation", "SLA", "33%"),
array("Motor", "Documentation", "KRA", "25%")
)
Sales
Motor
Documentation 10%
Doc revamp 43%
SLA 33%
KRA 25%
Communication 15%
Metro file 30%
Training 33%
Client Services 23%
Sales
xx Motor
xxx Documentation 10%
xxxx Doc revamp 43%
xxxxx SLA 33%
xxxxx KRA 25%
xxxx Communication 15%
xxxx Metro file 30%
xxxx Training 33%
xxxx Client Services 23%

No comments:

Post a Comment