title: Foreach and 2D Array in PHP
body: <pre><code>$mainMenu['Home'][1] = '/mult/index.php';
  $mainMenu['Map'][1] = '/mult/kar.php';
  $mainMenu['MapA'][2] = '/mult/kara.php';
  $mainMenu['MapB'][2] = '/mult/karb.php';
  $mainMenu['Contact'][1] = '/mult/sni.php';
  $mainMenu['Bla'][1] = '/mult/vid.php';
  </code></pre>
  
  <p><br>
  This is a menu, 1 indicates the main part, 2 indicates the sub-menu. Like:<br>
  </p>
  
  <p>Home<br>
  Map<br>
  -MapA<br>
  -MapB<br>
  Contat<br>
  Bla<br>
  </p>
  
  <p>I know how to use <code>foreach</code> but as far as I see it is used in 1 dimensional arrays. What I have to do in the example above?</p>