title: How do you access a nested array in smarty?
body: <p>So, I am using Smarty2 and don't know Smarty. Trying to learn it as I go.
   I have this array that is structured like this (from Var dump)</p>
  
  <pre><code>array(59) {
      [0]=&gt; array(4) {
          [0]=&gt; string(10) "CCX 4PLY"
          [1]=&gt; string(3) "SYP"
          [2]=&gt; string(4) "4X8 "
          [3]=&gt; array(6) {
              [0]=&gt; string(0) ""
              [1]=&gt; string(0) ""
              [2]=&gt; string(0) ""
              [3]=&gt; int(761)
              [4]=&gt; string(0) ""
              [5]=&gt; string(0) ""
          }
      }
      [1]=&gt; array(4) {
          [0]=&gt; string(5) " CCX"
          [1]=&gt; string(3) "SYP"
          [2]=&gt; string(4) "4X8 "
          [3]=&gt; array(6) {
              [0]=&gt; string(0) ""
              [1]=&gt; string(0) ""
              [2]=&gt; string(0) "" 
              [3]=&gt; string(0) ""
              [4]=&gt; int(823)
              [5]=&gt; int(937)
          }
      }
      ...
  }
  </code></pre>
  
  <p>The array is much longer, but that should be enough to give you an idea of what I have going. As you can see, inside each array, there is another array that gives the item prices. Sometimes there is no price, but that is fine. There shouldn't be on those occasions. 
  So, what I need to do is show the prices as they correspond to the specific item. Here is my code in smarty.</p>
  
  <pre><code>&lt;table&gt;
  {foreach name=outer item=row from=$indLine}
  &lt;tr&gt;
  {foreach key=key item=item from=$row}
  &lt;td&gt;{$item}&lt;/td&gt;
  {foreach key=price item=price from=$row}
  &lt;td&gt;{$indLine[4]}&lt;/td&gt;
  {/foreach}
  {/foreach}
  &lt;/tr&gt;
  {/foreach}
  </code></pre>
  
  <p></p>
  
  <p>My smarty variable for the array is indLine. indLine[4] is where I am trying to access that the prices. I have tried changing that to row, etc. Nothing works. What I get displayed in the browser is what follows.</p>
  
  <blockquote>
    <p>CCX 4PLY  Array   Array   Array   Array   SYP Array   Array   Array   Array   4X8 Array   Array   Array   Array   Array   Array   Array   Array   Array
            CCX Array   Array   Array   Array   SYP Array   Array   Array   Array   4X8 Array   Array   Array   Array   Array   Array   Array   Array   Array
            RSH 4-PLY   Array   Array   Array   Array   SYP Array   Array   Array   Array   4X8 Array   Array   Array   Array   Array   Array   Array   Array   Array
            RSH Array   Array   Array   Array   SYP Array   Array   Array   Array   4X8 Array   Array   Array   Array   Array   Array   Array   Array   Array
            S/F 4-PLY   Array   Array   Array   Array   SYP Array   Array   Array   Array   4X8 Array   Array   Array   Array   Array   Array   Array   Array   Array
         S/F SE Array   Array   Array   Array   SYP Array   Array   Array   Array   4X8 Array   Array   Array   Array   Array   Array   Array   Array   Array</p>
  </blockquote>
  
  <pre><code>CCX 4PLY    0   SYP 0   4X8 0   Array   0
  CCX 0   SYP 0   4X8 0   Array   0
  RSH 4-PLY   0   SYP 0   4X8 0   Array   0
  RSH 0   SYP 0   4X8 0   Array   0
  S/F 4-PLY   0   SYP 0   4X8 0   Array   0
  S/F SE  0   SYP 0   4X8 0   Array   0
  RSH 3-PLY   0   SYP 0   4X8 0   Array   0
  RSH 4-PLY   0   SYP 0   4X8 0   Array   0
  RSH 0   SYP 0   4X8 0   Array   0
  S/F 4-PLY   0   SYP 0   4X8 0   Array   0
  </code></pre>