if (isset($hierarchy)){ //$hierarchy[] = $selection; if (isset($hierarchy)){ while(list($level, $sel) = each($hierarchy)){ echo ""; echo $level, ': ', $sel, "n"; $nextlevel = (int) $level + 1; } } } else{ $nextlevel = 0; } echo "n"; for ($I = 1; $I echo "$In"; } echo "n"; ?>