I have two string that i want to limit to lets say the first 25 characters for example. Is there a way to cut off text after the 25th character and add a ... to the end of the s
May I make a modification to pallan's code?
$truncated = (strlen($string) > 20) ? substr($string, 0, 20) . '...' : $string;
This doesn't add the '...' if it is shorter.