I have done simple dynamic navigation in PHP like pulling HOME, ABOUT,FAQs, CONTACT from a array a then display it. Now I just need to know what and how can I code if FAQs has 4 more options to diplay after hovering the mouse over it.. I need some help in php coding not in CSS. Currently I'hv this scenario
<?php
$pages = array(
'index.php' => 'Home',
'cupping.php' => 'Cupping',
'success.php' => 'Success Stories',
'healing.php' => 'Healing',
'eating-right.php' => 'Eeating Right',
'blog.php' => 'Blog',
'faq.php' => 'FAQs',
'contact.php' => 'Contact Us',
) ;
<ul class="nav navbar-nav">
<?php foreach ($pages as $filename => $pageTitle) {
if ($filename == $currentPage) { ?>
<li class="current"><?php echo $pageTitle ; ?></li>
<?php } else { ?>
<li><a href="<?php echo $filename ; ?>"><?php echo $pageTitle ; ?></a></li>
<?php
} //if
} //foreach
?>
</ul>
Now how can I print HEALING that has also some nested navigation so the HTML after php coding look like this
<ul>
<li><ahref="index.php">Home</a></li>
<li><a href="cupping.php">Cupping</a></li>
<li><a href="success-stories.php">Success Stories</a></li>
<li><a href="healing.php">Healing Through</a></li>
<ul class="submenu">
<li><a href="herbs.php">Herbs</a></li>
<li><a href="nature.php">Nature</a></li>
<li><a href="behaviour.php">Behaviour</a></li>
</ul>
<li><a href="blog.php">Blog</a></li>
<li><a href="faqs.php">FAQs</a></li>
<li><a href="contact.php">Contact Us</a></li>
</ul>
I'm new to php and want some help. Thanks :)