Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $current_page = basename($_SERVER['PHP_SELF']);
- $pages = array("index.php" => "Home","about.php" => "About", "contact.php" => "Contact");
- echo "<ul id='menu'>";
- foreach($pages as $key => $value){
- if($current_page == $key){
- echo "<li class='selected'> <a href='$key'> $value </a></li>";
- }
- else{
- echo "<li> <a href='$key'> $value </a></li>";
- }
- }
- echo "</ul>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement