宽度不定的图片
宽度替换为100%
回复讨论(解决方案)
http://xxxx/uploads/details/142163431741415.jpg">
http://xxxx/uploads/details/14216343172321.jpg">
$str = '
';$str = '
';$str = '
';echo preg_replace('/(?<=style="width:).+?px;/i', '100%', $str);echo preg_replace('/(?<= 楼上 好像只能替换第一张图片的宽度,后面的无效 @xuzuning 怎么加上img限制 你测试了没有啊? 代码贴出来看看。
楼上 好像只能替换第一张图片的宽度,后面的无效 $str = '';//echo preg_replace('/(?<=style="width:).+?px;/i', '100%', $str);echo preg_replace('/(?<= 这样呢 echo preg_replace('/(?<= 