Sure, I am not using the above code anymore, but here is an example of something similar:
PHP code:
$files= findFiles($dir,'php'); //returns an array
asort($files);
$smarty->assign('numFiles',count($files));
$smarty->assign('files',$files);
Smarty code:
{if $numFiles > 0}
<strong>{$numFiles}</strong> PHP files found:
<ul>
{foreach item=file from=$files}
<li><a href="viewcode.php?file={$file}">{$file}</a></li>
{/foreach}
</ul>
{else}
<strong>No PHP files found.</strong>
{/if}
Note in above, each time it loops it puts the value in the array in the variable $file (not $files).
If you are doing associative array, it is a little different, if you need help with that let me know. Good luck.