Building Tree Structures in PHP Using References – VG Tech

The following code is a modified version of Tommy Lacroix’ solution as I found it to be a bit troublesome when using datasets from Zend_Db. Now you can do a $dataset->toArray() and the $references array will make sure it comes out correctly.
Erittäin hyvä tapa tehdä puurakenteita esim. CVS-tiedostosta, tai SQL-hausta PHP:ssä.