Regular expression examples

Spread the love

Remove style in html tag

$text = preg_replace(“/style=\”[^\”>]+\”/i”, ”, $text);


<span style=”font-family: Georgia, serif;” style=”font-family: Georgia, ‘Times New Roman’, Times, serif; font-size: 16px; line-height: 26px;”>some text</span>


<span >some text</span>

Facebook Comments

Published by

Titus Choi

I love technology. Working for information technology. Interested in AVR technology. Playing with RC stuff.