I need to search & replace inside HTML tags, CSS that was inlined, in order to avoid using the style="" attribute inline.
I.e. replace something that looks like this:
<table border="0" cellpadding="0" cellspacing="0" width="100%" style="font-family: Helvetica;line-height: 100%;margin-top: 20px; text-align: left;vertical-align: bottom;color: #202020">
into something like that:
<table border="0" cellpadding="0" cellspacing="0" width="100%" font-family="Helvetica" line-height="100%" margin-top="20px" text-align="left" vertical-align="bottom" color="#202020">
Does someone know the regex for search & replace I would have to write in order to do that?
Thanks.
preg_replace_callbackin PHP. Start withstyle="(.+?)". Also no way to know if attributes are valid going this route..font-familyattribute on atabletag won't do anything at all.