Showing categories and subcategories in a menu
What is the best way for Showing categories and subcategories in a menu with php? I have found a function here, But I cant understand the logic of $has_childs . wh开发者_如何学编程y
$has_childs = false;
and then
if ($has_childs === false)
{
$has_childs = true;
}
?
Thanks in advance
That variable means if the main link has any sub-categories. For example, a 'home' button would not have a dropdown, in other words, no child elements related to it. Whilst anything that did have a dropdown WOULD have child elements.
For more information you should google Parent/Child terminology in web programming.
精彩评论