{assign var="repeat" value='yes'}
{foreach from=$your_aray item=value}
{if … your case here}
{assign var="repeat" value='no' global=yes}
{/if}
{if $repeat eq 'yes'}
…Your action here
{/if}
{/foreach}
for($i=1;$i<10;$i++)
{section name=foo loop=9}
{$smarty.section.foo.iteration}
{/section}