$length) {
$end = $length;
}
for ($i = $start; $i < $end; $i++) {
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => true, // return headers
CURLOPT_FOLLOWLOCATION => false, // follow redirects
CURLOPT_USERAGENT => $sUserAgent, // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false, // Disabled SSL Cert checks
CURLOPT_TIMEOUT => 5, // timeout on response
CURLOPT_REFERER => $reffer,
CURLOPT_PROXY => $proxyList[$i],
);
//Raw CURL Start
$ch = curl_init($url);
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
$err = curl_errno($ch);
$errmsg = curl_error($ch);
$header = curl_getinfo($ch);
curl_close($ch);
$header[‘errno’] = $err;
$header[‘errmsg’] = $errmsg;
$header[‘content’] = $content;
//Raw CURL End
if ($header[‘http_code’] == 200) {
//转换为UTF-8编码
$htmlContentUtf8 = mb_convert_encoding($content, ‘utf-8’, ‘gbk’);
if (preg_match(‘/信息服务平台/iU’, $htmlContentUtf8)) {
echo ‘”‘ . $proxyList[$i] . “\”,\n”;
} else {
var_dump($content);
}
//var_dump($header);
//exit();
} else {
//var_dump($header);
}
}
echo ($end – $start) . ” test done.\n”;
http://pachong.org/transparent.html
http://www.66ip.cn/pt.html
http://www.kuaidaili.com/free/intr/
http://proxy.mimvp.com/free.php