[thelist] auto closing opened tags

Jeremy Weiss eccentric.one at gmail.com
Mon Feb 2 14:50:18 CST 2009


I'm trying to modify a PHP string trimming script so that when it
trims the string, it doesn't do it in the middle of an HTML tag and so
that it'll close any HTML tags that are open. (My first solution was
to just strip the HTML, but the client didn't like that idea) So I've
been playing with regex patterns most of the day and it seems that for
every 'solution' I think I've found, there still seem to be quite a
few exceptions.

Has anyone ran across an existing PHP script/function/class that does
this, by chance?

Thanks.

-jeremy



More information about the thelist mailing list