title: Using variable type variables as array names in php
body: <p>I'm trying to make a dynamic menu in my web, in which only some pages from each section will appear.</p>
  
  <p>The code I wrote was:</p>
  
  <pre><code>$menulist=array();
  
  $menulist[1]='file1%#16';
  
  $menulist[2]='file2%#9';
  
  $menulist[3]='file3%#19';
  
  $menulist[4]='file4%#8';
  
  $menulist[5]='file5%#13';
  
  $menulist[6]='file6%#14';
  
  $menulist[7]='file7%#10';
  
  $menulist[8]='file8%#23';
  
  $menulist[9]='file9%#19';
  
  $menulist[10]='file10%#18';
  
  $menulist[11]='file11%#12';
  
  function actualizaciones($matriz)
  
  {
  
  $linea=explode("%#",$matriz);
  
  echo '&amp;lt;li&amp;gt;&amp;lt;a href="first_chunk_of_URL'.$linea[0].'middle_chunk_of_url'.$linea[1].'last_chunk_of_URL"&amp;gt;'.${$linea[0]}[$linea[1]].'&amp;lt;/li&amp;gt;;
  
  }
  
  echo '&amp;lt;ul&amp;gt;';
  
  array_walk($menulist,'actualizaciones');
  
  echo '&amp;lt;/ul&amp;gt;';
  </code></pre>
  
  <p>Every <code>$linea[0]</code> string is the name of another array (not shown in this code) which contains the text that should be in every possible link corresponding to every key passed by <code>$linea[1]</code>. </p>
  
  <p>I must have done something wrong, because the hyperlinks work fine but there's no text showing on them.</p>