index.php
<?php
require("smarty/Smarty.class.php");
$tpl = new Smarty();
$tpl->template_dir = "./templates";    //模板目录
$tpl->compile = "./templates_c";    //编译目录
$tpl->left_delimiter = "<{";      // 左右边界符
$tpl->right_delimiter = "}>";
$tpl->assign('contents',array('555-222-9786','[email]636826@163.com[/email]',array('555-444-333','666-123-777')));
$tpl->display('index.tpl');
?>
 
index.tpl
<{$contents[0]}><br />
<{$contents[1]}><br />
<{$contents[2][0]}><br />
<{$contents[2][1]}><br />
 
output
555-222-9786
[email]636826@163.com[/email]
555-444-333
666-123-777