当前位置:Gxlcms > PHP教程 > php函数:域名whois查询(利用万网与新网接口查询)_PHP教程

php函数:域名whois查询(利用万网与新网接口查询)_PHP教程

时间:2021-07-01 10:21:17 帮助过:2人阅读

函数一:
//万网 whois(使用的接口为万网提供合法接口)
function whois_hichina($domain) {
preg_match("|
(. ?)
|is", @file_get_contents(http://whois.hichina.com/cgi-bin/whois?domain=.$domain.), $whois);
$whois[0] = str_replace(友情提示:按注册局要求,过期域名可能会处于注册商自动续费期阶段,您在此查询所看到的域名到期日仅供参考
请您进入会员区查看该域名的实际到期时间,并请及时进行续费,谢谢!, , ($whois[0]));//过滤掉此段文字
return $whois[0];
}
//函数调用
echo whois_hichina(www.ite5e.com)

函数二:
//新网 whois (非新网提供,只是根据新网自身网站的url修改实现)
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];

}
//函数调用
echo whois_xinnet(www.ite5e.com)
?>

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/486184.htmlTechArticle函数一: ?php //万网 whois(使用的接口为万网提供合法接口) function whois_hichina($domain) { preg_match("|pre(. ?)/pre|is", @file_get_contents(http://whois.hichin...

人气教程排行