PHP: Truncating Text

A common problem when creating dynamic web pages (where content is sourced from a database, content management system or external source such as an RSS feed) is that the input text can be too long and cause the page layout to ‘break’.

One solution is to truncate the text so that it fits on the page. This sounds simple, but often the results aren’t as expected due to words and sentences being cut off at inappropriate points.

More details here