PHP code example of azurre / php-whois

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

    

azurre / php-whois example snippets



s = new \Azurre\Component\Dns\Whois();

try {
    // Retrieve raw whois info
    $rawInfo = $whois->find($domain);
    
    // Retrieve parsed whois info
    $info = $whois->getInfo($domain);
    
    if ($whois->isAvailable('google.com')) {
        echo "Domain is available\n";
    } else {
        echo "Domain is registered\n";
    }
} catch (\Exception $e) {
    echo $e->getMessage();
}

curl -s https://getcomposer.org/installer | php

composer