Skip to content

Instantly share code, notes, and snippets.

@do9iigane
Created May 9, 2014 11:23
Show Gist options
  • Save do9iigane/f536dc1802902d5a8cc7 to your computer and use it in GitHub Desktop.
Save do9iigane/f536dc1802902d5a8cc7 to your computer and use it in GitHub Desktop.
PHPでwhois情報のCreation Dateを取得します。
<?php
//whois取得
$whois = file_get_contents('http://whoiz.herokuapp.com/lookup.json?url=interestic.com');
preg_match('/(.*)Creation\ Date:(.*)/', json_decode($whois), $match);
$createdeDate = new DateTime($match[2]);
$this->set('createdDate', $createdeDate->format('Y'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment