$content = $info['content']; $preg="/src=['\"]?(.*?)['\"]/" ; preg_match_all($preg, $content, $matches); $imgArr = array_unique($matches);//去除重复的值 echo count($imgArr[0]);//计数
$content = $info['content']; $preg="/src=['\"]?(.*?)['\"]/" ; preg_match_all($preg, $content, $matches); $imgArr = array_unique($matches);//去除重复的值 echo count($imgArr[0]);//计数
转载于:https://www.cnblogs.com/-ioi-/p/3503102.html