Utility to cut long text according to specified conditions (to make preview text, for example)
Small utility to adaptively cut long description for short previews., (*1)
Firstly, create an instance of TextCutter class and specify cutting method and type of text decoration like this:, (*2)
$textCutter = new TextCutter(TextCutter::METHOD_WHOLE_WORDS, TextCutter::DECORATION_ELLIPSIS);, (*3)
Now you can use $textCutter->cut($text, $length) method to cut your text!, (*4)
Sources Download
MIT
text cutter cut text text wrapper