err, a zasto mora da bude objekat koji rekurzivno kreira objekte, mogao si samo da imas rekurzivnu metodu:
PHP kôd:
function get_dirs($path) {
$result = array();
// get children paths, nekako
foreach($children_paths as $child_path) {
$result[] = $this->get_dirs($child_path);
}
return $result;
}