时间:2021-07-01 10:21:17 帮助过:26人阅读
有两个width和height,你要去掉哪个?
参考: http://blog.csdn.net/fdipzone/article/details/11884285
require('HtmlAttributeFilter.class.php');$str = '';$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,你要去掉哪个?
都去掉谢谢大家的热心回答