php - How to display the nested foreach values in smarty -
i need display nested for-each loop values in smarty.
i have array array ( [err] => 0 [code] => 0 [msg] => success [retval] => array ( [0] => array ( [id] => 8 [thread_id] => 8 [body] => hi test message [priority] => 1 [sender_id] => 11 [cdate] => 2015-06-01 12:26:55 [status] => 1 [subject] => hi [user_name] => soniya kaliappan ) ) )
how can retval['body'] value in smarty . please me .
simply run foreach
inside foreach
-
{foreach from=$yourarray item=loopval} {foreach from=$loopval.retval key=retval item=retval} {$retval.body} {/foreach} {/foreach}
or there 1 array inside retval
-
{foreach from=$yourarray item=loopval} {$loopval.retval.0.body} {/foreach}
Comments
Post a Comment