Posted By

exu on 01/28/11


Tagged

php whois


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

nickian
voove


Check domain creation date


 / Published in: PHP
 

simple one minute, you must have whois on your system

  1. <?php
  2. $domains = array('home.pl', 'w3c.org');
  3.  
  4. function creation_date($domain) {
  5. $lines = explode("\n", `whois $domain`);
  6. foreach($lines as $line) {
  7. if(strpos(strtolower($line), 'created') !== false) {
  8. return $line;
  9. }
  10. }
  11.  
  12. return false;
  13. }
  14.  
  15. foreach($domains as $d) {
  16. echo creation_date($d) . "\n";
  17. }

Report this snippet  

You need to login to post a comment.