title: PHP Multidimensional Arrays
body: <p>I'm trying to make a universal script that adds keywords to my individual pages (since header is in an include file) so I am getting the end of the url (multi.php) and retrieving the desc etc. from it's array. For some reason instead of returning keywords or descriptions it instead just returns "m" . . . it's kind of random and has me scratching my head. Here's what I got</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Multi-Demensional Array&lt;/title&gt;
  &lt;?php
  
  $path = pathinfo($_SERVER['PHP_SELF']);
  $allyourbase = $path['basename'];
  
  $pages = array
  (
      "multi.php" =&gt; array
      (
          "keywords"  =&gt; "index, home, test, etc",
          "desc"      =&gt; "This is the INDEX page",
          "style"     =&gt; "index.css"
      ),
  
      "header.php" =&gt; array
      (
          "keywords"  =&gt; "showcase, movies, vidya, etc",
          "desc"      =&gt; "SHOWCASE page is where we view vidya.",
          "style"     =&gt; "showcase.css"
      )
  );
  
  
  
  ?&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;?php 
  
  foreach($pages as $key =&gt; $value)
  {
      if($key == $allyourbase)
      {
          echo $key['desc'];
      }
  }
  
  ?&gt; 
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>