-4
<?php
include ($_SERVER['DOCUMENT_ROOT'].'/header.php');
include ($_SERVER['DOCUMENT_ROOT'].'/adtop.php');
if(mysql_num_rows($deals) > 0){
while($row = mysql_fetch_assoc($deals)){
echo '<div id="dealbox">';
echo '<div id="dealdesc class="more">';
echo $row['dealdesc'];
echo '</div>';
}
?>
如何限制$row['dealdesc']
顯示最多200個字符,並顯示「更多」按鈕,點擊後,將顯示$row['dealdesc']
全長?如何從字符串顯示最多200個字符
Letter?你的意思是人物?整個文本有多大? – Strawberry
你可以參考這個:http://jsfiddle.net/7Vv8u/5/ – Aparna
檢查此鏈接http://stackoverflow.com/questions/4258557/limit-text-length-in-php-and-provide-read-更多鏈接 –