This is in wordpress (not sure that makes a difference)
This bit of php outputs the post title
After you check the string length with strlen use substr
$string = "This is a large text for demonstrations purposes"; if(strlen($string) > 20) $string = substr($string, 0, 20).'...'; echo $string;
Outputs
"This is a large text..."