PHP Classes

Text Fit: Shorten text to fit within a limited length

Recommend this page to a friend!
  Info   Screenshots Screenshots   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 421 All time: 6,329 This week: 332Up
Version License PHP version Categories
text-fit 1.1.3GNU General Publi...5.0PHP 5, Text processing
Description Author

This class can shorten text to fit within a limited length.

It can shorten a given text string by truncating text that exceeds a given length.

The class can also shorten file names by limiting them to a given length but preserving the original file name extension.

It may also fit text into columns of table cells by either shortening or wrapping the text in the column.

Innovation Award
PHP Programming Innovation award nominee
December 2012
Number 3


Prize: One downloadable copy of PhpED Professional
Sometimes it is necessary to limit the length of text to be displayed in certain circumstances. That is the case of text in e-mail messages or file names.

This class provides a solution to truncate text in a way that it does not cut words in the middle.

It can also shorten file names in a way that they do not exceed a certain limit, but still keep the file extension at the end of the file name.

Manuel Lemos
Picture of Tony
Name: Tony <contact>
Classes: 6 packages by
Country: United States United States
Age: ???
All time rank: 1011135 in United States United States
Week rank: 238 Up23 in United States United States Up
Innovation award
Innovation award
Nominee: 2x

Screenshots  
  • TextFit-examples.png
  Files folder image Files  
File Role Description
Plain text file TextFit.class.php Class TextFit class
Accessible without login Plain text file examples.php Example Example script
Accessible without login Plain text file TextFit.doc.txt Doc. Usage information
Accessible without login Plain text file GPL.txt Lic. License information

 Version Control Unique User Downloads Download Rankings  
 0%
Total:421
This week:0
All time:6,329
This week:332Up
User Comments (1)
 
For more information send a message to info at phpclasses dot org.