I'm about at my wit's ends trying to figure out this problem. I'm not sure if I can't "see the forest because of the trees" so I'm hoping someone else can offer some ideas on this. 🙂
I'm working with an existing project that is generating these arrays that represent dynamically selected directory structures. So the array can change depending on what the user chooses to view. The problem I'm having is taking the array and displaying it in a tree view as it would look in an "Explorer" like view.
Here is an example array, the actual arrays could be nested much futher down, or could have only 1 or two sub directories.
[205882] => Array
(
[206155] => Array
(
[0] => Src
)
[222914] => Array
(
[0] => TimeClock Database
)
[236076] => Array
(
[0] => Setup
)
[236455] => Array
(
[0] => Other Files
)
)
[206155] => Array
(
[206156] => Array
(
[0] => TimeClock
)
[222903] => Array
(
[0] => TimeClock ActiveSync
)
)
[222914] => Array
(
[227172] => Array
(
[0] => TimeClock DB Updates
)
)
[236076] => Array
(
[236077] => Array
(
[0] => TimeClock
)
)
[236455] => Array
(
[236456] => Array
(
[0] => Batch
)
[236461] => Array
(
[0] => Scripts
)
[236463] => Array
(
[0] => Other Executables
)
)
[227172] => Array
(
[227173] => Array
(
[0] => Release 2
)
[227174] => Array
(
[0] => Release 3
)
)
I'm completely stumped on how to take this array and output something like this:
/root
+--Src
+---TimeClock
+---TimeClock ActiveSync
+--TimeClock Database
+---TimeClock DB Updates
+---Release 2
+---Release 3
+--Setup
+---TimeClock
+--Other Files
+---Batch
+---Scripts
+---Other Executeables
I'm sure this should be fairly straight forward, but I'm at a loss on how to proceed further. If anyone has any suggestions or pseudocode or anything, then you would be helping save what little sanity I still have left. 🙂
Thanks for reading this far down. 🙂