Separate menu's with php
<pre><code>&lt;?php
$nav ="";
if(isset($_SESSION['username'])){
    $navigatie = [
        'index.php' =&gt; 'Home',
        'addbar.php' =&gt; "Add Bar",
        'addbooze.php' =&gt; "Add Booze",
        'addresto.php' =&gt; "Add Resto",
        'addfood.php' =&gt; "Add Food",
        'bars.php' =&gt; "Check bars",
        'users.php' =&gt; "gebruikers",

    ];}
else{
    $navigatie = [
        'index.php' =&gt; 'Home',
        'login.php' =&gt; 'Login',
        'registreer.php' =&gt; 'Registreer',
    ];
}

foreach ($navigatie as $key =&gt; $value){
    $attr = '';
    if( $key == $current )
    {
        $attr = ' class="active"';
    }
    $nav .= '&lt;li' . $attr . '&gt;&lt;a href=" '. $key . '"&gt;' . $value . '&lt;/a&gt;&lt;/li&gt;';
}

?&gt;


&lt;nav&gt;
    &lt;div class="nav-wrapper light-blue darken-1"&gt;

        &lt;ul &gt;
            &lt;?php echo $nav ?&gt;
        &lt;/ul&gt;
        &lt;ul class="right-align"&gt;
            &lt;li&gt;&lt;a class="right-align red darken-4" href="logout.php"&gt;Logout&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
&lt;/nav&gt;
</code></pre>

<p>My question is, how can I add my addbar.php &amp; addbooze.php and addresto.php &amp; addfood.php in a dropdown menu? I'm using materialize as library. My menu is now a long menu bar and very ugly. It is controlled with a session and the dropdown has to disappear when the session isn't started.  </p>