Laravel & PHP $data->富文本字段= preg_replace('/<img\s+([^>]+)>/i', '<img $1 style="max-width: 100%;">', $data->富文本字段); Js解决 小程序富文本图片宽度自适应-CSDN博客