PHP code example of jsmitty12 / phpwhois

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

    

jsmitty12 / phpwhois example snippets


// Load composer framework
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
    ois->lookup($query,false);
echo "<pre>";
print_r($result);
echo "</pre>";

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

use phpWhois\Whois;
$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');

  use phpWhois\Whois;
  $whois = new Whois();
  $whois->useServer('uk','whois.ripe.net?-V{version},{ip} {query}');
  $result = $whois->lookup('62.97.102.115');
  

use phpWhois\Whois;
$whois = new Whois();
$whois->useServer('uk','whois.isoc.org.il?-V{version},{ip} {query}');
$result = $whois->lookup('example.co.uk');

use phpWhois\Whois;
$whois = new Whois();
$whois->useServer('uk','whois.nic.uk:1043?{hname} {ip} {query}');
$result = $whois->lookup('example.co.uk');

use phpWhois\Whois;
$whois = new Whois();
$whois->useServer('au','whois-check.ausregistry.net.au');

use phpWhois\Whois;
$whois = new Whois();
$whois->useServer('be','whois.tucows.com');

use phpWhois\Whois;
$whois = new Whois();
$whois->useServer('ip','whois.apnic.net');

$whois->deepWhois = false;