public function test($con){
$pattern = '/<img.*?src=\s*?"?([^"\s]+)(?!\/>)"?\s*?/is';//正则匹配图片
$r = preg_match($pattern,$con,$matches);
dd($matches);
$img = $matches[1];//获取图片路径
$imgs = 'https://www.ausck.com'.$img;//拼接
return $imgs;
$pattern = '/<img.*?src=\s*?"?([^"\s]+)(?!\/>)"?\s*?/is';//正则匹配图片
$r = preg_match($pattern,$con,$matches);
dd($matches);
$img = $matches[1];//获取图片路径
$imgs = 'https://www.ausck.com'.$img;//拼接
return $imgs;
}
$matches:
array:2 [▼ 0 => "<img src="/ueditor/php/upload/image/20180330/1522399247958071.jpg"" 1 => "/ueditor/php/upload/image/20180330/1522399247958071.jpg" ]