smarty使用:

<?php$items_list=array(23=>array('no'=>2456,'label'=>'Salad'),96=>array('no'=>4889,'label'=>'Cream'));$smarty->assign('items',$items_list);?><ul>{foreachfrom=$itemskey=myIditem=i}<li><ahref="http://blog.163.com/lgh_2002/blog/item.php?id={$myId}">{$i.no}:{$i.label}</li>{/foreach}</ul>上例将输出:<ul><li><ahref="http://blog.163.com/lgh_2002/blog/item.php?id=23">2456:Salad</li><li><ahref="http://blog.163.com/lgh_2002/blog/item.php?id=96">4889:Cream</li></ul>