Jump to content

strip HTML tags but leave <em> and <i>


tvdhoff

Recommended Posts

Hi all,

I need to strip all HTML tags from user input, save and .

I'm trying regular expressions, but am having big trouble getting those to work.

I thought of something like this (if found a tag with something else then 'i' remove tag): preg_replace(?(?=<[^i]+>)"");
But that doesn't work.

How would I go about that?

Thanks a lot!

Tim
Link to comment
https://forums.phpfreaks.com/topic/20984-strip-html-tags-but-leave-and/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.