SyntaxFix
Write A Post
Hire A Developer
Questions
Here you go:
<?php $html = '<p style="border: 1px solid red;">Test</p>'; echo preg_replace('/<p style="(.+?)">(.+?)<\/p>/i', "<p>$2</p>", $html); ?>
By the way, as pointed out by others, regex are not suggested for this.