IP Reverse Lookup domain name, now used is generally Bing's an IP query function, that is ip:222.222.222.222
The PHP code becomes
Calling methods
$result =getresult ("124.205.228.114");
Print_r ($result);
function GetContent ($url) {
$content =file_get_contents ($url);
return $content;
}
function GetResult ($IP) {
$pagesize = 10;
$page = 1;
$url = "http://cn.bing.com/search?q=ip%3a$ip&first= $page";
$result =array ();
Do
{
$url = "http://cn.bing.com/search?q=ip%3a$ip&first= $page";
$content =getcontent ($url);
$pattern = "/
([A-za-z0-9\.] *)(?:\ /.*)? <\/cite>/isu ";
Preg_match_all ($pattern, $content, $matches);
$result =array_merge ($result, $matches [1]);
$nextpage =strpos ($content, "next page");
$page = $page + $pagesize;
}while ($nextpage);
$result =array_values (Array_unique ($result));
return $result;
}
?>
Calling methods
$result =getresult ("124.205.228.114");
Print_r ($result);
function GetContent ($url) {
$content =file_get_contents ($url);
return $content;
}
function GetResult ($IP) {
$pagesize = 10;
$page = 1;
$url = "http://cn.bing.com/search?q=ip%3a$ip&first= $page";
$result =array ();
Do
{
$url = "http://cn.bing.com/search?q=ip%3a$ip&first= $page";
$content =getcontent ($url);
$pattern = "/ ([a-za-z0-9\.] *)(?:\ /.*)? <\/cite>/isu ";
Preg_match_all ($pattern, $content, $matches);
$result =array_merge ($result, $matches [1]);
$nextpage =strpos ($content, "next page");
$page = $page + $pagesize;
}while ($nextpage);
$result =array_values (Array_unique ($result));
return $result;
}
?
Excerpt from Gaohui blog
http:// www.bkjia.com/PHPjc/478440.html www.bkjia.com true http:// www.bkjia.com/PHPjc/478440.html techarticle IP reverse lookup domain name, now with the general Bing is an IP query function, that is, ip:222.222.222.222 written PHP code becomes?" PHP//Call method $result =getresult ( 124.205.228.114); Print_.