Skip to content

Instantly share code, notes, and snippets.

@baltpeter
Last active August 29, 2015 14:08
Show Gist options
  • Save baltpeter/600ae91f43b11904e559 to your computer and use it in GitHub Desktop.
Save baltpeter/600ae91f43b11904e559 to your computer and use it in GitHub Desktop.
Use freedomainapi.com to check whether a domain is available as both .de and .com
<?php
function checkdomain($domain) {
$api_req = file_get_contents('http://freedomainapi.com/?key=YOURAPIKEY&domain=' . $domain);
$api_req = json_decode($api_req, true);
if($api_req['available'] == 'true') return true;
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment