PHP to achieve the domain name whois query code of of data sources new network

  • 2020-03-31 20:25:39
  • OfStack

Whois (the interface used to provide a legal interface for wanwang)
 
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 registrar, expired domain names may be automatically renewed by the registrar. The expiry date you see here is for reference only <br /> Would you please <a href="http://www.net.cn/has_client/userlogon/user_logon1.asp" target="_blank" class="link_gl"> Enter the member area </a> Check the actual expiration time of this domain name, and please renew in time, thank you! ', '', ($whois[0]));//Filter out this text
return $whois[0]); 
} 

New web whois (provided by non-new web, just based on the new web site url modification implementation)
 
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 test, feel the new network query to a little faster, and some domain name query can not come out of the new network can also query!

Related articles: