public function imageUrl($content) {
$url = "http://".$_SERVER[‘SERVER_NAME‘];
$pregRule = "/<[img|IMG].*?src=[\‘|\"](.*?(?:[\.jpg|\.jpeg|\.png|\.gif|\.bmp]))[\‘|\"].*?[\/]?>/";
$list = preg_replace($pregRule, ‘<img src="‘.$url.‘${1}" style="max-width:100%">‘, $content);
return $list;
}
网友评论