Hi Guys to check the domain available or not and get it implement on PHP in your own site, you must use whois api.
1. Create a developer account on WHOIS.
2. The use following code to use in your PHP script
$contents = file_get_contents("http://www.whoisxmlapi.com//whoisserver/WhoisService?domainName=test.in&cmd=GET_DN_AVAILABILITY&username=username&password=password&outputFormat=JSON");
$contents = str_replace('\\', '', $contents);
$res=json_decode($contents);
$domainInfo = $res->DomainInfo;
if($domainInfo){
echo “Domain name: ” . print_r($domainInfo->domainName,1) .”
“;
echo “Domain Availability: ” .print_r($domainInfo->domainAvailability,1) .”
“;
//print_r($domainInfo);
}
?>
Try it…
