Limit Words in a String


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

If you wanted to do this effect quickly, you could just use the function substr(). However, the substr() function only limits the number of characters being displayed. The returned result would be an excerpt of text that may or may not have the ending word cut-off.

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.