Possible Duplicates:
Truncate a multibyte String to n chars
How to Truncate a string in PHP to the word closest to a certain number of characters?
eg:
PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works,
Only a portion of it should be displayed.
I have used the substr()
function, but the result may be PHP is a widely-used general-purp
. How can the output be truncated to a whole word, not part of one?