Created
October 30, 2018 14:54
-
-
Save JburkeRSAC/b8b9a12c24ca5191fc8bbc0aa0027a9f to your computer and use it in GitHub Desktop.
get an array of domain registration info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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