title: How to print the multi dimensional array values in smarty?
body: <p>I want to print the following array named <code>$all_class_subjects</code> in smarty template:</p>
  
  <pre><code>Array
  (
  [4] =&gt; Array
          (
              [class_id] =&gt; 5
              [class_name] =&gt; V
              [class_order] =&gt; 0
              [class_subject_assign] =&gt; 0
              [class_added_date] =&gt; 1365837028
              [class_updated_date] =&gt; 1365837028
              [class_added_staff_id] =&gt; ff8d4a5ea6bf11dce105aa2fa7b959b8
              [class_updated_staff_id] =&gt; ff8d4a5ea6bf11dce105aa2fa7b959b8
              [sub_data] =&gt; Array
                  (
                      [0] =&gt; Chemistry
                      [1] =&gt; Mathematics
                  )
  
          )
  )
  </code></pre>
  
  <p>And the code which I'm trying to print the array(not all elements only class_name, and subject names present in <code>sub_data</code> array):</p>
  
  <pre><code>{if $all_class_subjects}
           {foreach from=$all_class_subjects item=class_subject_data}
         &lt;tr&gt;
             &lt;td width="20%"&gt;{$class_subject_data.class_name|capitalize}&lt;/td&gt;
             &lt;td width="40%"&gt;
              {foreach from=class_subject_data.sub_data item=subject key=subject_name}
  
              &lt;b&gt;{$subject.subject_name}&lt;/b&gt;
                &lt;br /&gt;
              {/foreach}
  
           {/foreach}     h
  
             &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>But I'm not able to print the subject names of the sub_data array. So please help we by telling how to print those subject names. Please help me to print only those subject names, other things I'll manage on  my own. Thanks in advance.</p>