Hi, Does anyone have a simple script to check age of domain? I have checked whois script but the problem is gathering too much data where all I need for my program is the age of domain. Any inputs / guidance appreciated!
if (preg_match('/Creation Date: ([0-9]+\-[a-z]+\-[0-9]+)/i', $whois_output, $match)) { $creation_date = strtotime(trim($match[1])); $difference = time() - $creation_date; echo 'Domain is ' . floor($difference/(60*60*24)) . ' days old'; } else { echo 'no match found'; } PHP:
Thanks premiumscripts I would test this code and appreciate your quick response. Any way just to get date though - without processing the whole of whois response ?
No, not that I know of. You can check the enom api or other domain sellers, but they generally just allow you to query for the expiration date. Anyway, querying the whois seems like a fine solution, don't know why you'd want it any different.