PHP Classes

Smart String: Reformat text string to render within a box

Recommend this page to a friend!
  Info   View files Example   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 94 All time: 9,885 This week: 524Up
Version License PHP version Categories
smart-string 1.0.0The PHP License5PHP 5, Graphics, Text processing


This class can reformat text string to render within a box.

It can take a given text string and formats it so it can be rendered as graphics that fit within a box of a given width.

The class can use a giver TrueType font to test if the text fits within the given dimensions.

Picture of Roni
  Performance   Level  
Name: Roni is available for providing paid consulting. Contact Roni .
Classes: 12 packages by
Country: Bangladesh Bangladesh
Age: ???
All time rank: 279135 in Bangladesh Bangladesh
Week rank: 185 Up4 in Bangladesh Bangladesh Up
Innovation award
Innovation award
Nominee: 6x


include_once "lib/SmartString.php";

$text = "I reworked the feed reading signature images I made a while back and added something to trim the strings to a decent length without breaking words. So here you go. A one-liner that will ";

$str = new SmartString("This&nbsp;&nbsp;is &nbsp; &nbsp; a smart string with random words for testing", array(
'font_name' => 'arial',

$str2 = new SmartString($text,array(




Php String Manipulation Class

  Files folder image Files  
File Role Description
Files folder imagelib (1 file)
Accessible without login Plain text file example.php Example Example script
Accessible without login Plain text file Doc. Documentation

  Files folder image Files  /  lib  
File Role Description
  Plain text file SmartString.php Class Class source

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:9,885
This week:524Up