SyntaxFix
Write A Post
Hire A Developer
Questions
more flexible way is a function with two parameters:
function lchar($str,$val){return strlen($str)<=$val?$str:substr($str,0,$val).'...';}
usage:
echo lchar($str,200);