Advertisement
eimkasp

PHP Foreach example

Jun 12th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. <nav id="mk-vm-menu" class="mk-vm-menuwrapper menu-hover-style-2 js-main-nav">
  2.   <ul id="menu-main" class="mk-vm-menu">
  3.   <?php
  4.   $meniu_items = [
  5.         "Homepage" => "/",
  6.         "About us" => "/about.php",
  7.         "Coaches and personal" => "/coaches.php",
  8.         "U14-U18 Camp" => "vidinis.php" ,
  9.         "U8-U13 Camp" => "vidinis.php" ,
  10.         "Prices and registration" => "rezervacija.php"
  11.   ];
  12.  
  13.   foreach ($meniu_items as $pavadinimas => $nuoroda) : ?>
  14.    <li id="menu-item-16"
  15.         class="menu-item menu-item-type-post_type menu-item-object-page menu-item-home current-menu-item page_item page-item-5 current_page_item">
  16.       <a href="<?php echo $nuoroda; ?>">
  17.         <span class="meni-item-text">
  18.           <?php echo $pavadinimas; ?>
  19.         </span>
  20.       </a>
  21.     </li>
  22.    
  23.   <?php endforeach; ?>
  24.   </ul>
  25. </nav>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement