{* Smarty foreach/sample5-1.tpl *} <html> <head> <title>Smarty Test</title> </head> <body> <h1>{$title}</h1> {foreach from=$personaldata item=var name=loopname} <p>{$var}[{$smarty.foreach.loopname.index}]</p> {/foreach} </body> </html>