Example #1
0
function tree_recurse($id, $indent, $list, $children)
{
    if (@$children[$id]) {
        foreach ($children[$id] as $v) {
            $id = $v[0];
            $txt = $v[1];
            $pt = $v[2];
            $list[$id] = "{$indent} {$txt}";
            $list = tree_recurse($id, "{$indent}--", $list, $children);
        }
    }
    return $list;
}
Example #2
0
function tree_recurse($id, $indent, $list, $children)
{
    if (isset($children[$id])) {
        foreach ($children[$id] as $v) {
            $id = $v[0];
            $txt = $v[1];
            $pt = $v[2];
            $list[$id] = $indent . ' ' . $txt;
            $list = tree_recurse($id, $indent . '--', $list, $children);
        }
    }
    return $list;
}