Is there a way to trim a text string in PHP so it has a certain number of characters? For instance, if I had the string:
$string = \"this is a string\";
substr cuts words in half. Also if word contains UTF8 characters, it misbehaves. So it would be better to use mb_substr:
$string = mb_substr('word word word word', 0, 10, 'utf8').'...';