Bir div sınıfı hariç tüm html etiketlerini ve içeriği kaldır

0 Cevap php

Ben bir div sınıf dışında bir dize tüm html içeriği kaldırmak istiyorum: <div class="toto">blablabla</div>

Ben bir Regex veya DOM Parser kullanmalı mıyım?

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?

0 Cevap