Home >Backend Development >PHP Tutorial >PHP如何使用正则删除文章中的img的样式

PHP如何使用正则删除文章中的img的样式

WBOY
WBOYOriginal
2016-06-23 13:20:411239browse


这是原始代码

<p><span style="font-size: 14px"><strong>这里是小标题</strong></span></p><p>据统计,自行动开展以来,北京全市56个外围公安检查站已累计查获劣质烟花爆竹3500余公斤</p><br /><img alt="测试图测试图" src="http://127.0.0.1/upload/article/3/1_1450768388_8019104.png"   style="max-width:90%" width="max-width:90%;" /><br /><br /><img alt="测试图测试图1" src="http://127.0.0.1/upload/article/3/1_1450918929_9870605.jpg"   style="max-width:90%" />



我想达到的效果是
<p><span style="font-size: 14px"><strong>这里是小标题</strong></span></p><p>据统计,自行动开展以来,北京全市56个外围公安检查站已累计查获劣质烟花爆竹3500余公斤</p><br /><img alt="测试图测试图" src="http://127.0.0.1/upload/article/3/1_1450768388_8019104.png" /><br /><br /><img alt="测试图测试图1" src="http://127.0.0.1/upload/article/3/1_1450918929_9870605.jpg" />


回复讨论(解决方案)

$s = << 

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