Home  >  Article  >  Backend Development  >  PHP code to implement domain name whois query (data source Wanwang, Xinwang)_PHP tutorial

PHP code to implement domain name whois query (data source Wanwang, Xinwang)_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:41:07955browse

Wanwang whois (the interface used provides legal interface for Wanwang)

Copy code The code is as follows:

function whois_hichina($ domain) {
preg_match("|
(.+?)
|is", @file_get_contents('http://whois.hichina.com/cgi-bin/whois?domain= '.$domain.''), $whois);
$whois[0] = str_replace('Friendly reminder: According to the requirements of the registry, the expired domain name may be in the automatic renewal period of the registrar. You can check it here The domain name expiration date you see is for reference only
PleaseEnter the member areaCheck the actual expiration time of the domain name, and please renew it in time, thank you!', '', ($whois[0]));//Filter out this text
return $whois[0]);
}


Copy code The code is as follows:
function whois_xinnet($domain) {
preg_match("|
(.+?)
|is", @file_get_contents('http://www.xinnet.cn/Modules/agent/serv/pages/domain_whois.jsp?domainNameWhois='.$domain.'&noCode= noCode'), $whois);
return $whois[0];
}
}


Tested by Shanghai Telecom, I feel that the query on the new network is faster and more efficient. Some domain names cannot be queried on the Internet, but they can also be queried on the new website!

http://www.bkjia.com/PHPjc/321224.html

truehttp: //www.bkjia.com/PHPjc/321224.htmlTechArticleWanwang whois (the interface used provides legal interface for Wanwang) Copy the code as follows: function whois_hichina($domain ) { preg_match("|pre(.+?)/pre|is", @file_get_contents('http://whois...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn