PHP code example of shirakun / phpwhois

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

    

shirakun / phpwhois example snippets




$whois = new Whois();
$query = 'example.com';
$result = $whois->Lookup($query,false);
echo "<pre>";
print_r($result);
echo "</pre>";

$result = $whois->Lookup($query);

$whois = new Whois();
$result = $whois->Lookup('example.com');

$whois = new Whois();
$result = $whois->Lookup('62.97.102.115');

$whois = new Whois();
$result = $whois->Lookup('AS220');

  $whois = new Whois();
  $whois->UseServer('uk','whois.ripe.net?-V{version},{ip} {query}');
  $result = $whois->Lookup('62.97.102.115');
  

$whois = new Whois();
$whois->UseServer('uk','whois.isoc.org.il?-V{version},{ip} {query}');
$result = $whois->Lookup('example.co.uk');

$whois = new Whois();
$whois->UseServer('uk','whois.nic.uk:1043?{hname} {ip} {query}');
$result = $whois->Lookup('example.co.uk');

$whois = new Whois();
$whois->UseServer('au','whois-check.ausregistry.net.au');

$whois = new Whois();
$whois->UseServer('be','whois.tucows.com');

$whois = new Whois();
$whois->UseServer('ip','whois.apnic.net');

$whois->deep_whois = false;