Home >Backend Development >PHP Tutorial >求一个正则,去掉所有的font-size

求一个正则,去掉所有的font-size

WBOY
WBOYOriginal
2016-06-23 14:20:551424browse

                <td width="51"><img src="/app/webroot/emails/default/SingleProperty/Icon_Bed.jpg" width="51"    style="max-width:90%" alt="Bedrooms" /></td>                <td width="25" style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: #93bb3e;">4</td>                <td width="52"><img src="/app/webroot/emails/default/SingleProperty/Icon_Bath.jpg" width="52"    style="max-width:90%" alt="Bathrooms" /></td>                <td width="25" style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: #93bb3e;">2</td>                <td width="48"><img src="/app/webroot/emails/default/SingleProperty/Icon_Car.jpg" width="48"    style="max-width:90%" alt="Car Spaces" /></td>                <td width="25" style="font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold; color: #93bb3e;">1</td>              </tr>            </table></td>            <td align="right" valign="middle"><table width="374" border="0" cellspacing="0" cellpadding="0">              <tr>                <td width="361" align="right"><span style="color: #999;	font-family: Arial, Helvetica, sans-serif; font-size: 16px;">Bellevue Hill</span> - <span style="color: #78aa0e; font-family: Arial, Helvetica, sans-serif;	font-size: 16px; font-weight: bold;">$850,000</span></td>                <td width="13"> </td>              </tr>

去掉所有的 font-size: XXpx;   XX不固定


回复讨论(解决方案)

$content_html = preg_replace('/font-size:.*px;/','',$content_html);

自己试出来了。。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn