I don't really have a way to test it. See how this works (note: two changes -- don't forget the + 1): if (! empty($subs)) { /* $level++; */ $output .= displayChildren($subs, $level + 1); }
if (! empty($subs)) { /* $level++; */ $output .= displayChildren($subs, $level + 1); }