Page 1 of 1

Strip HTML

Posted: Wed Jan 31, 2007 2:16 pm
by user___
Hi guys,
I am developing a function that is supposed to print output taken from a database and I ned to count characters without HTML. I mean that if I have this string:

Code: Select all

<b>Hello</b><br />I am <br /> <img src="..."> here.<br />
I need to count "Hello"+"I am"+"here".

Posted: Wed Jan 31, 2007 2:26 pm
by feyd
strip_tags() or better equivalents.

Posted: Wed Jan 31, 2007 6:17 pm
by RobertGonzalez
Or a funky regular expression.

Posted: Wed Jan 31, 2007 8:15 pm
by feyd
Everah wrote:Or a funky regular expression.
... like the one linked from Useful Posts?! ;)

Posted: Wed Jan 31, 2007 11:27 pm
by RobertGonzalez
Yup, something like that...