2017 © Pedro Peláez
 

library text-truncation

image

timostamm/text-truncation

  • Tuesday, October 3, 2017
  • by timostamm
  • Repository
  • 1 Watchers
  • 0 Stars
  • 20 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 54 % Grown

The README.md

PHP Text Truncation Utility

This utility truncates plain text to a maximum length. It recognizes paragraphs, sentences and words and uses them to cut the text in a smart way., (*1)

Example


// Setup a truncation for a maximum string length of 370 characters. // Use the Paragraph-Strategy, which tries to find a paragraph // within the first 370 characters, and falls back to a sentence or // a word. $t = new Truncation( 370, Truncation::STRATEGY_PARAGRAPH ); // Apply the truncation $txt = $t->truncate( $x );

The Versions

03/10 2017

dev-master

9999999-dev

  Sources   Download

AGPL-3.0

The Requires

  • php >=7.1

 

The Development Requires