Tengo un codigo es de un menu con sub menus y no entiendo la parte donde dice $html.='<ul>';
yo se q es lo mismo que decir $html=$html.'<ul>'; pero como es posible si anteriormente $html no esta declarado..
si me podrian explicar esa parte, gracias
Código PHP:
function Menu($padre = 0)
{
global $link;
$query = "Select lista_id, lista_nombre, lista_orden, lista_padre
From lista
Where lista_padre = '" . $padre . "'
Order By lista_orden";
$lista = mysqli_query($link, $query);
if(mysqli_num_rows($lista) > 0)
{
//APARTIR DE ACA NO ENTIENDO
$html .= '<ul>';
while($row = mysqli_fetch_object($lista)) {
$html .= '<li>';
$html .= '<a href="index2.php?articulo=' . $row->lista_id . '">' . utf8_encode($row->lista_nombre) . '</a>';
$html .= Menu($row->lista_id);
$html .= '</li>';
}
$html .= '</ul>';
}
return $html;
}
echo Menu();