IT's a great function for sure, but I'm searching for something a little bit more advanced.
I don't like mixing PHP & HTML in template files.
That's some examples of TPL's with Smarty:
{include file="head.tpl"}
{if $Step == ""}
<b>Witam</b></td></tr><td align="justify">
Czym jest Night in Middle-Earth?<br>
Jest to tekstowy RPG dla wielu graczy, rozgrywany turowo.
Mo¿esz tutaj walczyæ z potworami, innymi graczami, zarz±dzaæ w³asn± stra¿nic± czy te¿ zarabiaæ pieni±dze na w³asnej kopalni b±d¼ wraz z innymi graczami stworzyæ w³asny klan.
Je¿eli zainteresowa³o Ciê to, zarejestruj siê w grze i do³±cz do nas.
Zanim jednak to zrobisz, przeczytaj <a href="index.php?step=rules">Kodeks</a> (czyli zasady obowi±zuj±ce w grze).<br><br><br><br>
<table cellpadding="0" cellspacing="0" width="100%">
<form method="post" action="updates.php">
<tr>
<td valign="top">
<table cellpadding="0" cellspacing="0" width="100%">{if $Online < 35}
<tr>
<td>Email: <input type="text" name="email"></td>
</tr>
<tr>
<td>Has³o: <input type="password" name="pass"></td>
</tr>
<tr>
<td><center><input type="submit" value="Zaloguj"></center></td>
</tr>
{/if}
{if $Online >= 35}
<tr>
<td>Za du¿o graczy w grze</td>
</tr>
{/if}
<tr>
<td><br><center><a href=index.php?step=lostpasswd>Zapomnia³em has³a</a></center><br><br></td>
</tr>
</table>
</td>
<td width="60%">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center"><b>Wie¶ci</b></td>
</tr>
<tr>
<td>{$Update[0]}</td>
</tr>
<tr>
<td>{$Update[1]}</td>
</tr>
<tr>
<td>{$Update[2]}</td>
</tr>
</table>
</td>
<td align="right" valign="top">
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td>Obecny czas: {$Time}</td>
</tr>
<tr>
<td>Mamy <b>{$Players}</b> zarejestrowanych graczy
</tr>
<tr>
<td><b>{$Online}</b> graczy w grze.<br></form></td>
</tr>
</table>
</td>
<tr>
<td>
{/if}
{include file="foot.tpl"}
// Sorry for polish language, don't think about parts in lang. you don't understand, it's not important now...
Uh, and loops:
<center>
<table>
<tr><td width="200">
<table class="td" width="100%" cellpadding="0" cellspacing="0">
<tr><td style="border-bottom: solid gray 1px;" align="center" colspan="2"><b><u>{$Title[0]}</b></u></td></tr>
<tr><td width="100" align="center"><b><u>Imiê (ID)</td><td width=100 align=center><b><u>{$Top[0]}</td></tr>
{section name=list loop=$Top1}
{$Top1[list]}
{/section}
</table>
</td><td width="200">
<table class="td" width="100%" cellpadding="0" cellspacing="0">
<tr><td style="border-bottom: solid gray 1px;" align="center" colspan="2"><b><u>{$Title[1]}</b></u></td></tr>
<tr><td width="100" align="center"><b><u>Imiê (ID)</td><td width="100" align="center"><b><u>{$Top[1]}</td></tr>
{section name=list1 loop=$Top2}
{$Top2[list1]}
{/section}
</table>
</td></tr>
<tr><td width="200">
<table class="td" width="100%" cellpadding="0" cellspacing="0">
<tr><td style="border-bottom: solid gray 1px;" align="center" colspan="2"><b><u>{$Title[2]}</b></u></td></tr>
<tr><td width="100" align="center"><b><u>Imiê (ID)</td><td width="100" align="center"><b><u>{$Top[2]}</td></tr>
{section name=list2 loop=$Top3}
{$Top3[list2]}
{/section}
</table>
</td><td width="200">
<table class="td" width="100%" cellpadding="0" cellspacing="0">
<tr><td style="border-bottom: solid gray 1px;" align="center" colspan="2"><b><u>{$Title[3]}</b></u></td></tr>
<tr><td width="100" align="center"><b><u>Imiê (ID)</td><td width="100" align="center"><b><u>{$Top[3]}</td></tr>
{section name=list3 loop=$Top4}
{$Top4[list3]}
{/section}
</table>
</td></tr></table>
As you can see using loops/if's in Smarty's tpls is easy, tho it's rather a big and slow parser for me, so that's why I'm saerching for something smaller.
Also, it supports caching results, which, as far I can see, your function does not support.