phpnerd Posted July 15, 2011 Share Posted July 15, 2011 Hi All, I would like to get domain age. I searched for code in google and I got the following code. class whois { const timeout = 30; const whoishost = 'whois.internic.net'; public static function lookup($domain){ $result = ""; $errno = 0; $errstr=''; $fd = fsockopen(whois::whoishost,43, $errno, $errstr, whois::timeout); if ($fd){ fputs($fd, $domain."\015\012"); while (!feof($fd)) { $result .= fgets($fd,128) . "<br />"; } fclose($fd); } return $result; } } $domain = 'google.com'; $result = whois::lookup($domain); if(strstr($result, " No match")){ echo $domain . " seems to be available"; }else{ echo $domain . " is in use"; echo "<hr>"; echo $result; } But this code returns a whole bunch of data all of which is not required. If it the output could be returned in an array, the desired result can be achieved. Can anyone suggest if there is any straight forward way to get individual data like the header response of a domain or may be the domain age. Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/242042-want-to-get-domain-age/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.