title: Multi dimensional array iteration Smarty
body: <p>I have two arrays. In first array I have Type and Zone field names. These two field names have multiple values. I am using smarty. I want the select name from the first array and options for each dropdown will come from the second array. This is what I have tried :</p>
  
  <pre><code>{foreach from=$field_names item=fld_name}
          &lt;tr&gt;
              &lt;td width="3%" height="15" style="font-weight:bold;height:30px; padding-top:5px;"&gt;&amp;nbsp;&lt;/td&gt;
              &lt;td width="32%" height="15" valign="middle" style="font-weight:bold;height:30px; padding-top:5px;"&gt;&amp;nbsp;{$fld_name}:&lt;/td&gt;
              &lt;td width="65%" height="15" valign="middle" style=" padding-top:5px;"&gt; 
                  &lt;select name="{$fld_name}" id="{$fld_name}" style="width:95px"&gt;
                      &lt;option value="-1"&gt;Any&lt;/option&gt;
                      {foreach from=$field_values item=fld_val key=key}
                          &lt;option value="{$fld_val.$key.value}"&gt;{$fld_val.$key.value}&lt;/option&gt;
                      {/foreach}
                  &lt;/select&gt; 
              &lt;/td&gt;
          &lt;/tr&gt;
          {/foreach}
  </code></pre>
  
  <p>This is the output of arrays :</p>
  
  <pre><code>This is the Output of first array:
  </code></pre>
  
  <p>Array
  (
      [2] => Type
      [1] => Zone
  )</p>
  
  <p>This is second array:
  Array
  (
      [0] => Array
          (
              [0] => Array
                  (
                      [productid] => 141
                      [fieldid] => 2
                      [value] => Laptop
                  )</p>
  
  <pre><code>        [1] =&gt; Array
              (
                  [productid] =&gt; 191
                  [fieldid] =&gt; 2
                  [value] =&gt; Books
              )
  
          [2] =&gt; Array
              (
                  [productid] =&gt; 177
                  [fieldid] =&gt; 2
                  [value] =&gt; Printer
              )
  
      )
  
  [1] =&gt; Array
      (
          [0] =&gt; Array
              (
                  [productid] =&gt; 141
                  [fieldid] =&gt; 1
                  [value] =&gt; 3
              )
  
          [1] =&gt; Array
              (
                  [productid] =&gt; 191
                  [fieldid] =&gt; 1
                  [value] =&gt; 4
              )
  
          [2] =&gt; Array
              (
                  [productid] =&gt; 177
                  [fieldid] =&gt; 1
                  [value] =&gt; 2
              )
  
      )
  </code></pre>
  
  <p>)</p>
  
  <p>I am getting the same options in both the dropdown. What Iam doing wrong please help..</p>
  
  <p>Thanks in advance.</p>