1. Go to this page and download the library: Download namingo/registrars library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namingo / registrars example snippets
declare(strict_types=1);
declare(strict_types=1);
NameCom;
use Namingo\Registrars\Registrar;
$adapter = new NameCom(
'username',
'api-token',
'https://api.dev.name.com'
);
$registrar = new Registrar($adapter);
$available = $registrar->available('example-domain.com');
var_dump($available);
declare(strict_types=1);
OpenSRS;
use Namingo\Registrars\Registrar;
$adapter = new OpenSRS(
'api-key',
'username',
'password',
'https://horizon.opensrs.net:55443'
);
$registrar = new Registrar($adapter);
$available = $registrar->available('example-domain.com');
var_dump($available);
use Namingo\Registrars\Contact;
$contact = new Contact(
'John',
'Doe',
'+1.5555555555',
'[email protected]',
'123 Example Street',
'',
'',
'Example City',
'Example State',
'US',
'12345',
'Example Company',
'owner'
);
$available = $registrar->available('example-domain.com');
if ($available) {
echo 'The domain is available.';
} else {
echo 'The domain is unavailable.';
}