tags:

views:

38

answers:

1

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 . why

 $has_childs = false;

and then

 if ($has_childs === false)
     {
         $has_childs = true;

     }

?

Thanks in advance

A: 

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.

duckbox