PHP code for domain name whois query (data source HiChina, Xinnet ). The code for copying the HiChina whois code is as follows: functionwhois_hichina ($ domain) {preg_match (| pre (. + ?) Pre | is, @ file_get_contents (whois HiChina whois (the interface used provides valid interfaces for HiChina)
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
Please go to the member area to check the actual expiration time of the domain name, and renew it in time. thank you! ', '', ($ Whois [0]); // filter out the text
Return $ whois [0]);
}
Xinnet whois (provided by non-Xinnet, but modified based on the url of Xinnet's own website)
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];
}
}
Shanghai Telecom's test showed that Xinnet's query was faster and some HiChina domain names could not be found. Xinnet could also be found!
Using whois (the interface used to provide valid interfaces for HiChina) Code: function whois_hichina ($ domain) {preg_match ("| pre (. ++ ?) /Pre | is ", @ file_get_contents ('http: // whois...