PHP code example of lander931 / whois

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

    

lander931 / whois example snippets





$sld = 'reg.ru';

$domain = new \Lander931\Whois\Whois($sld);

$whois_answer = $domain->info();

echo $whois_answer;

if ($domain->isAvailable()) {
    echo "Domain is available\n";
} else {
    echo "Domain is registered\n";
}


$sld = 'reg.ru';

$domain = new \Lander931\Whois\Whois($sld, [
    'host' => '127.0.0.1',
    'port' => '30000',
    'user' => 'user',
    'pass' => 'secret'
]);