下表打印出整个评论(($rowquote["comment"])
)。我怎么能限制它到250个字符?限制为250个字符
由于提前,
约翰
echo "<table class=\"samplesrec1quote\">";
while ($rowquote = mysql_fetch_array($resultquote)) {
echo '<tr>';
echo '<td class="sitename1quote">"'.stripslashes($rowquote["comment"]).'"</td>';
echo '</tr>';
}
echo "</table>";
编辑:我得到了它与left(comment, 250)
查询工作。所以我猜jensgram应该得到他在别人的答案下的评论。
[将多字节字符串截断为n个字符](http://stackoverflow.com/问题/ 2154220/truncate -a-multibyte-string-to-n-chars) - 包含截断字符串的解决方案,并且不考虑字边界 – Gordon 2010-11-19 09:27:20
lol..4的完全相同的答案 – mpen 2010-11-19 09:27:29