Skip to content

Instantly share code, notes, and snippets.

@JburkeRSAC
Created October 30, 2018 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JburkeRSAC/b8b9a12c24ca5191fc8bbc0aa0027a9f to your computer and use it in GitHub Desktop.
Save JburkeRSAC/b8b9a12c24ca5191fc8bbc0aa0027a9f to your computer and use it in GitHub Desktop.
get an array of domain registration info
<?php
require 'vendor/autoload.php';
use phpwhois\phpwhois;
if (!isset($argv[1])) {
echo "\nUsage:\n\nphp ".__FILE__." domainname.com\n";
exit(1);
}
$domain = $argv[1];
$whois = new Whois();
$whois->deep_whois=TRUE;
$result = $whois->lookup($domain);
#print_r($result);
$raw_data = $result["rawdata"];
$arr = [];
foreach($raw_data as $item) {
list($k, $v) = explode(":", $item);
$arr[trim($k)] = trim($v);
}
print_r($arr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment