Hey guys,
I have an array structure such: (pid = the parent ID)
Array
(
[0] => Array
(
[id] => 1
[pid] => -1
[name] => Parent
)
[1] => Array
(
[id] => 2
[pid] => 1
[name] => Tier 1a
)
[2] => Array
(
[id] => 3
[pid] => 1
[name] => Tier 1b
)
[3] => Array
(
[id] => 4
[pid] => 3
[name] => Tier 2
)
)
This makes up a folder structure.
for example: id=4, the path is /Parent/Tier 1b/Tier 2
What I need is an easy way to generate the paths of every folder and store them in an array thus:
$arr[$id] = $path;
If it wasn't for the fact I made the array multidimensional, I would probably be able to work out how to do it. The only way I can see is to do lots of looping.