title: Yet another simple php array looping newbie
body: <p>Sorry I am sure this is easy but I have spent ages trying to solve this simple problem. I have an array called <code>$listOfLinks</code>. When I <code>print_r</code> this is the output:</p>
  
  <pre><code>Array ( [0] =&gt; Array ( [LinkID] =&gt; 1 [GroupID] =&gt; 1 [Description] =&gt; Home [Title] =&gt; Home Page [Hyperlink] =&gt; [Target] =&gt; ) [1] =&gt; Array ( [LinkID] =&gt; 2 [GroupID] =&gt; 1 [Description] =&gt; View Employees [Title] =&gt; View Employees [Hyperlink] =&gt; Views/ViewEmployees.php [Target] =&gt; ) )
  </code></pre>
  
  <p>I want to loop through the array printing out things such as the <code>Title</code>. So far my code looks like this:</p>
  
  <pre><code>foreach($listOfLinks as $key =&gt; $element)
  {
      echo $key["Title"];
  }
  </code></pre>
  
  <p>Something is wrong as the output is absolutely nothing. There is no error. message or anything. I have been trying to follow the advice on <a href="http://www.tizag.com/phpT/arrays.php" rel="nofollow noreferrer">http://www.tizag.com/phpT/arrays.php</a> but I seem to have misunderstood something.</p>
  
  <p>This link to <a href="https://stackoverflow.com/questions/2483596/foreach-loop-returning-null-values-in-php">Foreach loop returning null values in PHP?</a> looked promising but it ultimately turned out to be a simple problem unrelated to mine. Also promising was <a href="https://stackoverflow.com/questions/8685825/php-loop-through-multidimensional-array-and-establish-parent-child-relationship">PHP: Loop through multidimensional array and establish parent-child relationships between array items</a> but it did not have a suitable solution. I thought I was close with this <a href="https://stackoverflow.com/questions/6767700/simple-array-question-in-php">Simple array question in PHP</a> but it turned out to be unrelated. This also looked promising but wasn't. <a href="https://stackoverflow.com/questions/7029748/php-yet-another-multidimensional-associative-array-problem">PHP Yet another Multidimensional Associative Array problem</a>. </p>
  
  <p>It looks like the answer is at <a href="https://stackoverflow.com/questions/4626602/another-php-array-looping-question">Another php array looping question</a> but I don't understand it if it is there.</p>
  
  <p>Please don't hate me for such a simple question. I have really been trying really hard to understand this.</p>