How do i implement a dynamic navigation in php?
e.g
Home | about | contact | faq | tutorials
i need to automatically generate the links dynamically
If you just want to display a menu for a known set of pages without re-architecting your current code, how about this:
'Home',
'about.php' => 'About',
'contact.php' => 'Contact',
'faq.php' => 'FAQ',
'tutorials.php' => 'Tutorials',
) ;
$currentPage = basename($_SERVER['REQUEST_URI']) ;
?>
Put this in its own file, say menu.php, and then include it in each page. Then you can style your menu with CSS.