serrg/text-cutter

Utility to cut long text according to specified conditions (to make preview text, for example)

Maintainers

Package info

github.com/lamp-of-god/text-cutter

pkg:composer/serrg/text-cutter

Statistics

Installs: 43

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-master 2015-11-22 11:34 UTC

This package is not auto-updated.

Last update: 2026-03-15 02:04:42 UTC


README

Small utility to adaptively cut long description for short previews.

Usage

Firstly, create an instance of TextCutter class and specify cutting method and type of text decoration like this:

$textCutter = new TextCutter(TextCutter::METHOD_WHOLE_WORDS, TextCutter::DECORATION_ELLIPSIS);

Now you can use $textCutter->cut($text, $length) method to cut your text!