PHP中smarty模板截取字符串问题。本人初学者
<?phpinclude_once'system/system.inc.php';$sql="select*fromnewlimit10";//国内$no1=$admin...
<?php
include_once 'system/system.inc.php';
$sql = "select * from new limit 10";//国内
$no1 = $admindb->ExecSQL($sql,$conn);
$smarty->assign('no1',$no1);
//$smarty->display('iLeft.html');
?>
iLeft.html
{section name=id loop=$no1}
<tr>
<td height="20"><img src="images/yuanquan.gif" width="13" height="10"> <span class="tw">
{$no1[id].title}</span>//问题所在,我只想取钱10个字符,其他用省略号
</td>
</tr>
{/section}
该怎么做! 展开
include_once 'system/system.inc.php';
$sql = "select * from new limit 10";//国内
$no1 = $admindb->ExecSQL($sql,$conn);
$smarty->assign('no1',$no1);
//$smarty->display('iLeft.html');
?>
iLeft.html
{section name=id loop=$no1}
<tr>
<td height="20"><img src="images/yuanquan.gif" width="13" height="10"> <span class="tw">
{$no1[id].title}</span>//问题所在,我只想取钱10个字符,其他用省略号
</td>
</tr>
{/section}
该怎么做! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询