PHP code for domain name whois query (Data Source hichina, xinnet)

Source: Internet
Author: User

Hichina whois (the interfaces used provide valid interfaces for hichina)
Copy codeThe Code is as follows:
Function whois_hichina ($ domain ){
Preg_match ("| <pre> (. + ?) </Pre> | is ", @ file_get_contents ('HTTP: // whois.hichina.com/cgi-bin/whois? Domain = '. $ domain. ''), $ whois );
$ Whois [0] = str_replace ('note: as required by the Registry, expired domain names may be in the automatic renewal phase of the Registrar, the domain name expiration date you see here is for reference only <br/> Please <a href = "http://www.net.cn/has_client/userlogon/user_logon1.asp" target = "_ blank" class = "link_gl"> enter the member area </ a> View the actual expiration time of the domain name, please 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)
Copy codeThe Code is as follows:
Function whois_xinnet ($ domain ){
Preg_match ("| <div class =" lyTableInfoWrap "> (. + ?) </Div> | 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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.