title: How to get values from a multidimensional array in Twig?
body: <p>A var_dump for my array $strs[$key][$id] gives the following result:</p>
  
  <pre><code>array(2) {
      [0]=&gt; array(4) {
          [8259]=&gt; string(8260) "ouvrir 1"
          [8260]=&gt; string(8261) "fichier 2"
          [8261]=&gt; string(8262) "quitter 1"
          [8262]=&gt; string(8263) "lire 2"
      }
      [1]=&gt; array(4) {
          [8259]=&gt; string(8260) "lancer 2"
          [8260]=&gt; string(8261) "dossier 1"
          [8261]=&gt; string(8262) "exit 1"
          [8262]=&gt; string(8263) "lire 2"
      }
  }
  </code></pre>
  
  <p>In my view, I'm tying to get all the strings with the same $id from all the $key. Something like this:<br/>
  1-<br/>
  ouvrir 1<br/>
  lancer 2<br/>
  2-<br/>
  fichier 2<br/>
  lancer 2<br/></p>
  
  <p>etc</p>
  
  <p>I've tried this in my twig view:</p>
  
  <pre><code>{% for key,val in strs['key']['id']  %}
      {% if strs['key']['id'] is defined %}
       {{ key }} - &lt;br/&gt;      
       {{ val }}       
      {% endif %}   
  {% endfor %}
  </code></pre>
  
  <p>I got this error:<br/>
  Key "key" for array with keys "0, 1" does not exist in...<br/>
  What Am I doing wrong here? And how can I get the result I'm looking for?</p>