Guest User

Untitled

a guest
May 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. <?php
  2. $items = array(
  3. array('link' => '/test/', 'label' => 'Home', 'tags' => 'accesskey="0" name="Home" title="Home (AccessKey: 0)" id="http-Home" rel="follow" class="internal-link"'),
  4. array('link' => '/products/', 'label' => 'Products', 'tags' => 'accesskey="1" name="Products" title="Products (AccessKey: 1)" id="http-Products" rel="follow" class="internal-link"'),
  5. array('link' => '/services/', 'label' => 'Services', 'tags' => 'accesskey="2" name="Services" title="Services (AccessKey: 2)" id="http-Services" rel="follow" class="internal-link"'));
  6.  
  7. $menu = '';
  8.  
  9. foreach ($items as $val) {
  10. $menu .= '|&#160;
  11. ';
  12. $menu .= '<span';
  13. // if ($_SERVER['PHP_SELF'] == $val['link'])
  14. if ($_SERVER['REQUEST_URI'] == $val['link'])
  15. $menu .= ' class="current"';
  16. $menu .= '>
  17. <a href="'.$val['link'].'" '.$val['tags'];
  18. $menu .= '>'.$val['label'].'</a>
  19. </span>
  20. &#160;
  21. ';
  22. }
  23. echo $menu;
  24. ?>
Add Comment
Please, Sign In to add comment