A McGraw Hill Book Plug-in PHP: 100 Power Solutions
By Robin Nixon (McGraw Hill 2010, ISBN 978-0071666596)

Home | About | Buy It | Download | Contact

Select Chapter: 1  2  3  4  5  6  7  8  9 10 11 12

Chapter 3: Plug-in 7 - Text Truncate

Have you noticed how the results provided by the Google search engine always neatly display snippets of information from each website, without truncating text mid word? Now you can cut long strings short in a similar manner using this plug-in.

The Figure shows three snippets from the first paragraph of Charles Dickens' A Tale of Two Cities.