求教一正则

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:28:29993browse

<nav class="xqlj mt15">      <div class="spxq"><img src="/static/imghwm/default1.png"  data-src="1.jpg"  class="lazy"      style="max-width:90%"  style="max-width:90%" alt="" border="0" /><iframe src="http://www.tudou.com/programs/view/html5embed.action?type=1&code=vZ00D1Xubu4&lcode=q711Bs57_Nw&resourceId=0_06_05_99" allowtransparency="true" allowfullscreen="true" allowfullscreeninteractive="true" scrolling="no" border="0" frameborder="0" style="width:1200px;height:500px;"></iframe></div>   </nav>


怎么去掉 这段里的 width 和 height


回复讨论(解决方案)

有两个width和height,你要去掉哪个?

参考: http://blog.csdn.net/fdipzone/article/details/11884285

require('HtmlAttributeFilter.class.php');$str = '<nav class="xqlj mt15">      <div class="spxq"><img src="/static/imghwm/default1.png"  data-src="1.jpg"  class="lazy"      style="max-width:90%"  style="max-width:90%" alt="" border="0" /><iframe src="http://www.tudou.com/programs/view/html5embed.action?type=1&code=vZ00D1Xubu4&lcode=q711Bs57_Nw&resourceId=0_06_05_99" allowtransparency="true" allowfullscreen="true" allowfullscreeninteractive="true" scrolling="no" border="0" frameborder="0" style="width:1200px;height:500px;"></iframe></div>   </nav>';$obj = new HtmlAttributeFilter();// 允许id属性$obj->setAllow(array('src','alt','border'));$obj->setException(array());// img 标签忽略,不过滤任何属性$obj->setIgnore(array('nav','div','iframe'));echo 'source str:
';echo htmlspecialchars($str).'

';echo 'filter str:
';echo htmlspecialchars($obj->strip($str));

有两个width和height,你要去掉哪个?

  都去掉

谢谢大家的热心回答

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