I'm trying to strip out the "style" attribute from a bit of user input. If the user input is $input, why wouldn't the following, given
leave me with
It doesn't take out anything at all!
Code:
<tag style="blah" href="site">Content</tag>
Code:
<tag href="site">Content</tag>
Code:
$strip_regexp = array('/(.*)style=\".*\"(.*)/', '/(.*)style=\'.*\'(.*)/');
$input = preg_replace($strip_regexp, "$1$2", $input); // apply strip_regexp