php - Limit text length and putting read more button -
php - Limit text length and putting read more button -
i want set read more button @ end of content block , limit length of content block 200 characters. code
<?php echo $row["newscontent"] ?>
how can limit $row["newscontent"] 200 characters?
you can limit length of $row['newscontent'] substr function
echo substr($row['newscontent'], 0, 199);
there various hang-ups should aware of though: take 200 characters, doesn't handle multibyte strings (utf-8 etc) , if newscontent contains markup, broken
php
Comments
Post a Comment