Sub-string function based on words


/ Published in: PHP
Save to your folder(s)

I need often for dynamic websites a text snippet with an extact text length. Using the PHP function substr() is a solution, but makes the last word unreadable. This tiny function takes care about the max. string length characters, keeps the last word intact and will add a custom string to the end. This string can be some dots or maybe the link to the whole text.

URL: http://www.finalwebsites.com/portal

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.