, the back of the background passed an array, with a foreach loop, I just want to get the last loop invalid_num the value should be how to fetch AH
{foreach from= $bonus item=item Name=bonus}
{/foreach}
I'm using it out of the loop,
Use of this judgment, did not take to
{if $smarty. Foreach.bonus.last}
{$item.Invalid_num}
{/if}
Reply content:
, the back of the background passed an array, with a foreach loop, I just want to get the last loop invalid_num the value should be how to fetch AH
{foreach from= $bonus item=item Name=bonus}
{/foreach}
I'm using it out of the loop,
Use of this judgment, did not take to
{if $smarty. Foreach.bonus.last}
{$item.Invalid_num}
{/if}
The values of all invalid_num are stored in the current $key
array, count length, and then taken out, $array[$count - 1]
Reference document [] ()
Reference documents
{foreach $items as $item} {if $item@last} //这里就是最后一条数据了 {/if}{/foreach}