Showing posts with label substr. Show all posts
Showing posts with label substr. Show all posts

Friday, May 4, 2012

Using PHP substr() and strip_tags() while retaining formatting and without breaking HTML


I have various HTML strings to cut to 100 characters (of the stripped content, not the original) without stripping tags and without breaking HTML.