Jump to content

Recommended Posts

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.

 

 

Link to comment
https://forums.phpfreaks.com/topic/242042-want-to-get-domain-age/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.