1、php函数
//抓取图片路径
function curlImg($text)
{
//正则
$reg = '#.*<img src="(.*)" .*>.*#iUs';
preg_match_all($reg,$str,$result);
print_r($result[1]);
}
//文本内容
$text = '<p>11111<img src="https://cdn.pixabay.com/photo/2017/07/17/00/58/coffee-2511065__340.jpg" alt="" width="500" height="500" />22222</p>';
//调用函数
curlImg($text);
2、 抓取结果