网站模板仿制之提取页面图片的正则表达式
2024-12-29 21:54:06网站扒皮
摘要:获取html页面所有的图片URL的函数
$pattern = '/
preg_match_all($pattern, $content, $matches);
$arr_images=array();//原始图片集合
if(isset($matches['url'])){
foreach ($matches['url'] as $key => $value) {
if(!in_array($value, $arr_images))
$arr_images[]=$value;
}
}