Home > Backend Development > PHP Tutorial > Whois PHP implements domain name whois query code data source Wanwang, Xinwang

Whois PHP implements domain name whois query code data source Wanwang, Xinwang

WBOY
Release: 2016-07-29 08:41:59
Original
1781 people have browsed it

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

Copy the code The code is as follows:


function whois_hichina($domain) {
preg_match("|

(.+?)< ;/pre>|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
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]);
}


 Xinnet whois (not provided by Xinnet, just based on Xinnet URL modification implementation of own website)

Copy the 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 Xinwang is faster, and some domain names that cannot be queried on Wanwang can also be queried on Xinwang!

The above introduces whois PHP to implement domain name whois query code data source Wanwang, Xinwang, including whois content, I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template