Advertisement
cafreak

Navigation bar using arrays in php

May 5th, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2. $nav_normal = array("1. Home","2. Read Me","3. License Agreement","4. General Information","5. Database Installer","6. Create an Account","7. Create Config","8. Successfully installed"
  3.     );
  4.    
  5. $last_normal = array_pop(array_keys($nav_normal));
  6.  
  7. foreach($nav_normal as $name){
  8.  
  9.     if($Nav_ID == $name){
  10.         $Nav_Type = "Selected";
  11.     }else{
  12.         $Nav_Type = "Unselected";
  13.     }
  14.    
  15.     ?><li class="<?php echo($Nav_Type); ?>"><?php echo($name); ?></li><?php
  16.         if($name != $last_normal){
  17.             echo("\n                    ");
  18.         }else{
  19.             echo("\n");
  20.         }
  21.    
  22. }  
  23. ?></ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement