1). preg_match:正则匹配,返回:后面的字符串
$defaultpic="http://www.baidu.com";
preg_match("/[^:]+$/", $defaultpic, $matches);
$default_https='https:'.$matches[0];
$matches的运行结果为:[0=>'//www.baidu.com']
2). str_replace:字符串替换需要替换的字符
$content="<img src='/uditor/www/fans/upload/fhj9fwefaklooos.jpg'>";
if(strpos($content,'src="/ueditor')===false){
$photos=str_replace('\\','',$content); //用空的字符串替换反斜杠,如果没有反斜杠则不用替换
$photos=str_replace('src="/ueditor','src="http://www.baidu.com/ueditor',$photos);
$data->content_host=$photos;
}
*将返回的相对路径的图片更改为带域名的绝对路径