title: How to grab the keys and value from an array in an array with php
body: <p><code>print_r($top5)</code> gives me an array like this:</p>
  
  <pre><code>Array ( 
      [title1] =&gt; Array ( 
                  [id_1] =&gt; 4 
                  )
      [title2] =&gt; Array ( 
                  [id_2] =&gt; 5 
                  ) 
      [title3] =&gt; Array ( 
                  [id_3] =&gt; 8 
                  ) 
      [title4] =&gt; Array ( 
                  [id_4] =&gt; 3 
                  ) 
      [title5] =&gt; Array ( 
                  [id_5] =&gt; 2 
                  ) 
      )
  </code></pre>
  
  <p>I want to produce an output in a foreach loop where i need all the values of this array:</p>
  
  <pre><code>&lt;a href="page=?"&lt;?php echo $id; ?&gt;"&gt;&lt;?php echo $title.' '.$number; ?&gt; 
  </code></pre>
  
  <p><code>$top5</code> is the array and when i use a foreach like below:</p>
  
  <pre><code>foreach($top5 as $key =&gt; $val) {
      echo $key // outputs the name of title
      echo $val // outputs nothing;
               // i need to output the id and number as well, belonging to each title
  
  }
  </code></pre>