/** * 富文本图片通用 */ public function set_img_style(&$activity) { $activity['guest'] = preg_replace("/ [0-9]*px;/", "max-100%;", $activity['guest']); $activity['guest'] = preg_replace("/width="[0-9]*"/", "", $activity['guest']); $activity['guest'] = str_replace("<img", "<img style='max-100%;height:auto;'", $activity['guest']); $activity['guest'] = str_replace("style="", "style="100%;", $activity['guest']); }