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\";
function trimtext($text, $start, $len) { return substr($text, $start, $len); }
You can call the function like this:
$string = trimtext("this is a string", 0, 10);
Would return:
This is a