I'm writing a small static site and I've got a navigation menu as an unordered list with CSS styling. I am styling the menu to highlight the current page using a different class to the rest of the menu. I usually use <?php include('navigation.html'); ?> an external navigation file so that changes to the site structure can be added globally. Is there an easy way to use php to read the current page and style the list appropriately?
James
CSS Menu highlighting current page
Moderator: General Moderators
Re: CSS Menu highlighting current page
Code: Select all
$page = basename($_SERVER['PHP_SELF']);