0

I just would like to know how to do this?
Just like facebook!


Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam fermentum posuere arcu lobortis mattis. In eu nisl turpis. Praesent mi dui, dignissim et rhoncus nec, sodales vel sapien. In hac habitasse platea dictumst. Etiam quis felis vitae magna volutpat eleifend eu cursus nunc. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer non magna non ipsum rhoncus fringilla ac eget risus. Etiam nibh tellus, viverra vitae congue eu, dapibus a odio. Nullam ante purus, interdum vitae suscipit euismod, luctus et sem. Phasellus vulputate, justo vitae elementum scelerisque

I want it to look like this

Lorem ipsum dolor sit amet, co...

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by ko ko
0

Use this:

$your_text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam fermentum posuere arcu lobortis mattis. In eu nisl turpis. Praesent mi dui, dignissim et rhoncus nec, sodales vel sapien. In hac habitasse platea dictumst. Etiam quis felis vitae magna volutpat eleifend eu cursus nunc. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer non magna non ipsum rhoncus fringilla ac eget risus. Etiam nibh tellus, viverra vitae congue eu, dapibus a odio. Nullam ante purus, interdum vitae suscipit euismod, luctus et sem. Phasellus vulputate, justo vitae elementum scelerisque";
 
$VarLength = strlen($your_text);
if ($VarLength > 30) {
/*Add "..." after 30 charecters*/ 
$your_text = substr($your_text,0,30) . "..."; 
}
echo $your_text;
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.