Remove all html tags and content except for a div class

Posted by Crazy on Stack Overflow See other posts from Stack Overflow or by Crazy
Published on 2011-01-09T06:30:18Z Indexed on 2011/01/09 6:53 UTC
Read the original article Hit count: 273

Filed under:
|
|
|

I want to remove all html content from a string except for a div class : <div class="toto">blablabla</div>

Should I use a Regex or DOM Parser?

To answer drachenstern :

It's a comment content with bbcode. And the html in this div is generated with Geshi (code highlighter) so i don't want to delete this.

For example a visitor can enter <script></script> in a [code][/code] bbcode tag. All HTML outside the [code][/code] bbcode tag must be delete no?

© Stack Overflow or respective owner

Related posts about php

Related posts about html