I'm using the following piece of regex to filer content, however I need users to be able to add iframes in the wysiwyg editor, and currently its striping those out, how can I edit this to keep all of its functionality but stop it from stripping out iframes? Thank you
$content = preg_replace("%<[a-z]{1,6}[^>]*>\s*</[a-z]{1,6}>%ims","",$content);
Use this regex :
$content = preg_replace("%(</?(?!iframe)[a-z0-6]{0,10}[^>]>)%im", "", $content);
or better :
strip_tags($content, "<iframe>");