https://www.gxlcms.com/
$str = 'https://www.gxlcms.com/
';
https://www.gxlcms.com/
宽度替换为100%https://www.gxlcms.com/
https://www.gxlcms.com/
$str = '
';
回复讨论(解决方案)
$str = '
';echo preg_replace('/(?<=style="width:).+?px;/i', '100%', $str);


echo preg_replace('/(?<=
楼上 好像只能替换第一张图片的宽度,后面的无效
@xuzuning 怎么加上img限制
你测试了没有啊? 代码贴出来看看。https://www.gxlcms.com/
https://www.gxlcms.com/
楼上 好像只能替换第一张图片的宽度,后面的无效
$str = '




';//echo preg_replace('/(?<=style="width:).+?px;/i', '100%', $str);echo preg_replace('/(?<=
这样呢https://www.gxlcms.com/
echo preg_replace('/(?<=
