Login   Register  
PHP Classes
elePHPant
Icontem

Text Fit: Shorten text to fit within a limited length

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   Screenshots Screenshots   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2012-12-04 (1 year ago) RSS 2.0 feedNot enough user ratingsTotal: 413 All time: 5,813 This week: 1,745Up
Version License PHP version Categories  
text-fit 1.1.3GNU General Public Lice...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: 4 packages by
Country: Australia Australia
Age: ???
All time rank: 123219 in Australia Australia
Week rank: 817 Up9 in Australia Australia 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:413All time:5,813
 This week:0This week:1,745Up
 User Comments (1)