{* Smarty foreach/sample6-1.tpl *}
<html>
<head>
<title>Smarty Test</title>
</head>
<body>

<h1>{$title}</h1>
{foreach from=$personaldata item=var name=loopname}
{if $smarty.foreach.loopname.first}
<p>最初の要素:{$var}</p>
{elseif $smarty.foreach.loopname.last}
<p>最後の要素:{$var}</p>
{else}
<p>要素:{$var}</p>
{/if}
{/foreach}

</body>
</html>