求助,PHP修改显示行数及显示字数

求助,PHP修改显示行数,现在显示为20行,使其能调整显示行数,并修改标题显示字数,使其能显示18个字,再多的字以“....”省略。
原代码如下:
<td height="27" bgcolor="#FFFFFF"><table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<?
while($arrRow_syzx = mysql_fetch_assoc($result_syzx)){
?>
<tr>
<td height="22" ><a class="<?=$arrRow_syzx[Chu_css]?>" href="<?=$arrRow_syzx[Class_id]?>/<?=$arrRow_syzx[Chu_id]?>.html">
<?=$arrRow_syzx[Chu_title]?>
</a></td>
<td width="60" align="center"><?=$arrRow_syzx[Chu_mianji]?></td>
<td width="80" align="center"><?=$arrRow_syzx[Chu_tel]?></td>
</tr>
<tr>
<td height="1" colspan="3" background="images/xuxian.jpg"></td>
</tr>
<?
}
?>
</table></td>

调整显示行数:可以在你的SQL语句后面加上limit如:select*from test limit 10

控制字数:substr函数
温馨提示:答案为网友推荐,仅供参考