Page 1 of 1

strip_tags()

Posted: Sun Mar 26, 2006 12:54 pm
by evilmonkey
Hello,

I was wondering about the strip_tags() command in PHP. It seems to strip absolutely everything that begins with a <. For example:
<bob> - gone
<bob - gone
what's up> -stays (common typo btw)

Is there any way for it to strip only HTML tags, as opposed to random stuff like <bob>?

Thanks!

Posted: Sun Mar 26, 2006 12:57 pm
by feyd
As you noticed, strip_tags() strips anything that may be a tag, it doesn't consider HTML vs XML vs XYZ.

viewtopic.php?t=45984