Home  >  Article  >  Backend Development  >  PHP function: domain name whois query (using Wanwang and Xinwang interface query)_PHP tutorial

PHP function: domain name whois query (using Wanwang and Xinwang interface query)_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:40:50942browse

Function one:
//Wanwang whois (the interface used provides legal interface for Wanwang)
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, expired domain names may be in the automatic renewal period of the registrar. The domain name expiration date you see in this query is for reference only
Please Enter the member area to view 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];
}
//Function call
echo whois_hichina(www.ite5e.com)

Function 2:
//Xinnet whois (not provided by Xinnet, just based on Xinnet URL modification implementation of the network's own website)
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];

}
//Function call
echo whois_xinnet(www.ite5e.com)
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/486184.htmlTechArticleFunction 1: ?php //Wanwang whois (the interface used provides legal interface for Wanwang) function whois_hichina ($domain) { preg_match("|pre(. ?)/pre|is", @file_get_contents(http://whois.hichin...
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