标签:jpeg style bmp gif png $_server return img lis
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;
}
标签:jpeg style bmp gif png $_server return img lis
原文地址:http://blog.51cto.com/pilipala/2155131