php一个图片采集程序 图片采集类
2012-10-08 13:45:48 来源:WEB开发网核心提示:preg_match_all(self::prel,$code,$arrimg);$arr = array_merge($arr,$arrimg[0]);$imgkey = array_merge($imgkey,$arrimg[1]);}return array($arr,$imgkey);}else{$code =
preg_match_all(self::prel,$code,$arrimg);
$arr = array_merge($arr,$arrimg[0]);
$imgkey = array_merge($imgkey,$arrimg[1]);
}
return array($arr,$imgkey);
}else{
$code = file_get_contents($url);
preg_match_all(self::prel,$code,$arrimg);
return $arrimg;
}
}
//检验数据
private function checkdata($url,$prefix,$style){
if(empty($url)){
return 1;
}elseif(!is_array($style)){
return 2;
}elseif(count($style)==0){
return 3;
}elseif(stripos($prefix,'.') !== false || stripos($prefix,'/') !== false || stripos($prefix,'|') !== false){
return 4;
}
}
}
?>
$arr = array_merge($arr,$arrimg[0]);
$imgkey = array_merge($imgkey,$arrimg[1]);
}
return array($arr,$imgkey);
}else{
$code = file_get_contents($url);
preg_match_all(self::prel,$code,$arrimg);
return $arrimg;
}
}
//检验数据
private function checkdata($url,$prefix,$style){
if(empty($url)){
return 1;
}elseif(!is_array($style)){
return 2;
}elseif(count($style)==0){
return 3;
}elseif(stripos($prefix,'.') !== false || stripos($prefix,'/') !== false || stripos($prefix,'|') !== false){
return 4;
}
}
}
?>
更多精彩
赞助商链接