You can use this:
Say you store the text in a variable named $text.
You can use strlen($text) to see how many chars long does this entry have. Then you can use the substr() function to cut the string.
Example:
$text = "I'm a veeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeery bad user";
echo substr($text,0,20);
This would print only the 20 first characters in the string.
fLIPIS