帝国wap内容模板里过滤掉图片尺寸的方法
在帝国WAP模版的show.temp.php文件里面,输出新闻正文的标签为
1 |
<?=DoWapRepNewstext( $r [newstext])?> |
想把把里面图片的style 尺寸标签给过滤掉,不然手机浏览图片宽与高严重比率失真。
下面提供帝国wap内容模板里过滤掉图片尺寸的方法
1 |
<? |
2 |
$xstyle =DoWapRepNewstext( $r [newstext]); |
3 |
$xstyle =preg_replace( '/style=.+?[\'|\\\"]/i' , '' , $xstyle ); |
4 |
echo $xstyle ; |
5 |
?> |