I have a text file that looks like this:
Root
-Heading1
--SubHeading1
---Sub-SubHeading1
--SubHeading2
-Heading2
---SubHeading3
I need to put this into a tree data structure. First of all, does PHP have any built-in tree classes or methods? Secondly, I know recursion is the way to go, but I need a push in the right direction. Any code or psuedo-code would be great. Thanks!