php: check domain availability
<?php
//Check the availability of Domain Name
function check_domain_availability($domain)
{
$recordexists = checkdnsrr($domain, "ANY");
if ($recordexists) echo "The domain name has been taken. Sorry!";
else echo "The domain name is available!";
}