Skip to content

Instantly share code, notes, and snippets.

@AndrewChamp
Created December 22, 2015 20:51
Show Gist options
  • Save AndrewChamp/6289e70f908913e07943 to your computer and use it in GitHub Desktop.
Save AndrewChamp/6289e70f908913e07943 to your computer and use it in GitHub Desktop.
Checks if a domain is available or taken.
<?php
$domain = parse_url($_GET['domain']);
$explode = array_reverse(explode('.', $domain['path']));
$dns = dns_get_record($explode['1'].'.'.$explode['0'], DNS_A);
if(count($dns) > 0):
print 'Domain Taken';
else:
print 'Domain Avaliable.';
endif;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment