title: Why is my PHP function not producing any output?
body: <p>The following code shows a multi-dimensional array, and a function that loops through the array to echo out a nested menu with links. </p>
  
  <p>However, the function doesn't appear to be working as nothing is being echoed. </p>
  
  <p>It was working but I have changed a few includes around, so could it be something to do with that?</p>
  
  <pre><code>&lt;?php
  
  $urls = array (
      0=&gt;array (
          0=&gt;"Home",
          1=&gt;"http://uni.michaelnorris.co.uk/",
          2=&gt;"Home",
          3=&gt;"",
          4=&gt;"",
          5=&gt;"1"
      ),
  
      1=&gt;array (
          0=&gt;"Blog",
          1=&gt;"http://uni.michaelnorris.co.uk/blog/",
          2=&gt;"Blog",
          3=&gt;"",
          4=&gt;"",
          5=&gt;"1"
      ),
  
      2=&gt;array (
          0=&gt;"Glossary",
          1=&gt;"http://uni.michaelnorris.co.uk/",
          2=&gt;"Glossary",
          3=&gt;"",
          4=&gt;"",
          5=&gt;"1"
      ),
  
      3=&gt;array (
          0=&gt;"Resources",
          1=&gt;"http://uni.michaelnorris.co.uk/blog/",
          2=&gt;"Resources",
          3=&gt;"",
          4=&gt;"",
          5=&gt;"1"
      ),
  
      4=&gt;array (
          0=&gt;"Staff",
          1=&gt;"http://uni.michaelnorris.co.uk/",
          2=&gt;"Staff",
          3=&gt;"",
          4=&gt;"",
          5=&gt;"1"
      ),
  
      5=&gt;array (
          0=&gt;"Blog",
          1=&gt;"http://uni.michaelnorris.co.uk/blog/",
          2=&gt;"Blog",
          3=&gt;"",
          4=&gt;"",
          5=&gt;"1"
      ),
  
      6=&gt;array (
          0=&gt;"Home",
          1=&gt;"http://uni.michaelnorris.co.uk/",
          2=&gt;"Home",
          3=&gt;"",
          4=&gt;"",
          5=&gt;"1"
      ),
  
      7=&gt;array (
          0=&gt;"Blog",
          1=&gt;"http://uni.michaelnorris.co.uk/blog/",
          2=&gt;"Blog",
          3=&gt;"",
          4=&gt;"",
          5=&gt;"1"
      )       
  );
  
  function showMenu()
  {
      $top = count($urls);
      echo "&lt;ul&gt;";
      for ($i=0;$i&lt;$top;$i++) {
          echo "&lt;li&gt;&lt;a href='".$urls[$i][1]."' title='".$urls[$i][2]."'&gt;".$urls[$i][0]."&lt;/a&gt;&lt;li&gt;";
      }
      echo "&lt;/ul&gt;";
  }
  
  ?&gt;
  
  &lt;?php showMenu(); ?&gt;
  </code></pre>