PHP code example of realtimeregister / realtimeregister-php

1. Go to this page and download the library: Download realtimeregister/realtimeregister-php 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/ */

    

realtimeregister / realtimeregister-php example snippets




use RealtimeRegister\RealtimeRegister;

$realtimeRegister = new RealtimeRegister('my-secret-api-key');

$realtimeRegister->contacts->list('johndoe');



use RealtimeRegister\IsProxy;

$isProxy = new IsProxy('my-secret-api-key');

if ($result = $isProxy->check('example', 'com')) {
    if ($result->isAvailable()) {
        echo "{$result->getDomain()} is available.";
    } else {
        echo "{$result->getDomain()} is not available.";
    }
}

// example.com is available.



use RealtimeRegister\IsProxy;

$isProxy = new IsProxy('my-secret-api-key');

foreach ($isProxy->checkMany('example', ['nl', 'com', 'net', 'org']) as $result) {
    echo $result->getDomain() . $result->isAvailable() ? ' ✅' : ' ❌';
}
// example.nl ✅
// example.com ❌
// example.net ✅
// example.org ✅
bash
composer