Code: Select all
$content = preg_replace('/<\/?((b|strong)\W[^>]*)>/is', '*', $content);Problem is...I don't understand how it's working...I get that it's matching two tags...but why does the non-alphanumeric have to follow? Shouldn't it be whitespace - if anything?
Secondly, I have tried to adapt this regex so that both opening and closing tags are replaced with asterisks using the following:
Code: Select all
$content = preg_replace('/<(\/?((b|strong)\W[^>]*))>/is', '*', $content);Help
Cheers