手机端百度编辑器图片自适应 $data['content'] = preg_replace( '/(<img.*?)(style=.+?[\'|"])|((width)=[\'"]+[0-9]+[\'"]+)|((height)=[\'"]+[0-9]+[\'"]+)/i','$1',$data['content']); $data['content'] = str_replace("<img", "<img style='max-width:100%;height:auto;'", $data['content']);