在CodeIgniter中获取whois输出
我想从我的CodeIgniter控制器调用WHOIS域查找服务,需要返回数组输出。我刚刚和WHOIS支持团队讨论过,他们说他们不提供API调用。你知道怎么做吗?在CodeIgniter中获取whois输出,codeigniter,whois,Codeigniter,Whois,我想从我的CodeIgniter控制器调用WHOIS域查找服务,需要返回数组输出。我刚刚和WHOIS支持团队讨论过,他们说他们不提供API调用。你知道怎么做吗?我找到了呼叫WHOIS域锁定服务的最佳方法 I Got Best way to call WHOIS domain lockup services <?php $username="username"; $password="password"; $contents = file_get_contents("http
我找到了呼叫WHOIS域锁定服务的最佳方法
I Got Best way to call WHOIS domain lockup services
<?php
$username="username";
$password="password";
$contents = file_get_contents("http://www.whoisxmlapi.com//whoisserver/WhoisService?domainName=google.com&username=$username&password=$password&outputFormat=JSON");
//echo $contents;
$res=json_decode($contents);
if($res){
if($res->ErrorMessage){
echo $res->ErrorMessage->msg;
}
else{
$whoisRecord = $res->WhoisRecord;
if($whoisRecord){
echo "Domain name: " . print_r($whoisRecord->domainName,1) ."<br/>";
echo "Created date: " .print_r($whoisRecord->createdDate,1) ."<br/>";
echo "Updated date: " .print_r($whoisRecord->updatedDate,1) ."<br/>";
if($whoisRecord->registrant)echo "Registrant: <br/><pre>" . print_r($whoisRecord->registrant->rawText, 1) ."</pre>";
//print_r($whoisRecord);
}
}
}
?>
错误消息){
echo$res->ErrorMessage->msg;
}
否则{
$whoisRecord=$res->whoisRecord;
如果($whoisRecord){
echo“域名:”.print\r($whoisRecord->domainName,1)。“
”;
echo“创建日期:”.print_r($whoisRecord->createdDate,1)。“
”;
echo“更新日期:”.print_r($whoisRecord->updatedate,1)。“
”;
如果($whoisRecord->注册人)回显“注册人:
”。打印($whoisRecord->注册人->原始文本,1)。”;
//打印(whoisRecord);
}
}
}
?>
尝试此api谢谢您的回复。事实上我得到了答案。所以如果你有答案,更新你的问题或发布答案