title: Check if key exists in smarty array
body: <p>I have an array that looks like this:</p>
  
  <pre><code>array(
      'name1' =&gt; array('city1', 'city2', 'city3'),
      'name2' =&gt; array('city1', 'city4'),
      'namen' =&gt; array('city1', 'city7', 'cityn')
  );
  </code></pre>
  
  <p>Which is passed to smarty as : <code>$my_names</code>
  There is a loop in my Smarty template that looks like this:</p>
  
  <pre><code>{{foreach from=$names item=name}}
    {{foreach from=$cities item=city}}
    //Check if name1 exist and after check if the city is in the array for that name
    {{/foreach}}
  {{/foreach}}
  </code></pre>
  
  <p>I fail to see how would I use the <code>$name</code> and <code>$city</code> to access the array <code>$my_names</code></p>
  
  <p>I have tried doing <code>if($my_names.$name.$city)</code>, but it doesn't work.</p>