Skip to content

Latest commit

 

History

History
28 lines (21 loc) · 622 Bytes

README.md

File metadata and controls

28 lines (21 loc) · 622 Bytes

php whois query library

The https://packagist.org/packages/io-developer/php-whois project is great.

I'll leave my project for php version 5.

$ php composer.phar require "crucifyer/phpwhois" "dev-master"
$domain = 'github.com'; // not support subdomain.

$info = \Xeno\Net\Whois\Whois::query($domain);

use \Xeno\Net\Whois\Whois; // shortly

if(Whois::isRegistered($info, $domain)) {
	echo "$domain was registered\n";
	if(false === ($expiry = Whois::getExpiryDate($info))) {
		echo "expiry date not found\n";
	} else {
		echo "expiry date: $expiry\n";
	}
} else {
	echo "$domain not found\n";
}