How to get the domain age in PHP


/ Published in: PHP
Save to your folder(s)

This code is to find the domain age in PHP.


Copy this code and paste it in your HTML
  1. <?php
  2. //// Description:
  3. //********************************************************************************/
  4. // The purpose for this code is to find the domain age.
  5. // Please enter the key and domain before you run the code , /
  6. // For information, please visit https://www.ip2whois.com /
  7. //********************************************************************************/
  8. $apiKey = 'Enter_License_Key';
  9. $domain = 'Enter_Domain_Name';
  10. $url = "https://api.ip2whois.com/v2?key=$apiKey&domain=$domain";
  11. $data = json_decode(file_get_contents($url),true);
  12. echo "<br>Domain: ",$data['domain'], "<br>";
  13. echo "Domain Age: ",$data['domain_age'] ," days<br><br>";
  14. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.