//正则匹配获取img标签src内容-多个
function get_imgAllSrc($tag) {
// print_r($tag);die;

preg_match_all('/(id|alt|title|src)=("[^"]*")/i', $tag, $matches);

$ret = array();
foreach($matches[0] as $i => $v) {
$ret[] = trim($matches[2][$i],'"');

}

return $ret;
}

参考链接:https://blog.csdn.net/qq_27270307/article/details/90702259

posted on 2019-10-16 15:20  河岸晚风  阅读(2067)  评论(0编辑  收藏  举报