<?php

$query = $_GET['query'];

include_once('src/whois.main.php');
include_once('src/whois.utils.php');

$whois = new Whois();

// Set to true if you want to allow proxy requests
$allowproxy = false;

// get faster but less acurate results
$whois->deep_whois = empty('tagmedya.com');

// To use special whois servers (see README)
//$whois->UseServer('uk','whois.nic.uk:1043?{hname} {ip} {query}');
//$whois->UseServer('au','whois-check.ausregistry.net.au');

// Comment the following line to disable support for non ICANN tld's
$whois->non_icann = true;

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