PHP實現(xiàn)查詢未注冊的域名,具體代碼如下:
$url = 'http://www.qiuyumi.com/dict2/?n1=&d1=1&n2=&d2=1&n3=&s=0&p=';
$num = 161604/200; #
#$num = 1;
for($i=1;$i<=$num ; $i++){
echo $url = 'http://www.qiuyumi.com/dict2/?n1=&d1=1&n2=&d2=1&n3=&s=0&p=' . $i;
$str = file_get_contents($url);
preg_match_all("/<div class=\"domainname\">(.*)<\/div>/i",$str,$arr);
foreach($arr[1] as $v){
$v = trim(strip_tags($v));
echo $xml = file_get_contents('http://panda.www.net.cn/cgi-bin/check.cgi?area_domain='.$v);
$arrXml = (array)simplexml_load_string($xml);
if($arrXml['original'] == '210 : Domain name is available'){
$f = fopen('ostm.net.txt','a+');
fwrite($f,$v . "\r\n");
fclose($f);
}
}
}
更多信息請查看IT技術(shù)專欄