日期:2014-05-17 浏览次数:20555 次
<img width="200" src="http://www.macaucentral.com/dev/images/stories/jreviews/649_Image00001_1304589016.jpg">
<img width="80" height="80" src="http://www.macaucentral.com/dev/images/stories/jreviews/649_Image00001_1304589016.jpg">
<?php $str='<img width="200" src="http://www.macaucentral.com/dev/images/stories/jreviews/649_Image00001_1304589016.jpg">'; echo preg_replace('/width="\d+"/','width="80" height="80"',$str);
------解决方案--------------------
如果要在前台展示的时候动态替换的话那就非js莫属了。
要是后台那就php处理吧