$tree = taxonomy_get_tree($vid);
print "<li>"; // 1 line
foreach ($tree as $term ) { // 2 lines
$diffdepth=0;
if ($term->depth > $depth) {
print "<ul class='haschild'><li>";
$depth = $term->depth;
}
the above is the original code, now I want according to $term->depth > $depth
make a condition to output.( print "<li>";
) this line.
namely,
if ($term->depth > $depth) {
echo '<li class="parent">';
}
else {
print "<li>";
}
but $term->depth
can use after foreach loop, but i want to use it at 1 line, how do i do?