How can PHP be used to retrieve the last update date of a website using Whois APIs?

To retrieve the last update date of a website using Whois APIs in PHP, you can make a request to a Whois API service that provides this information. You will need to pass the domain name as a parameter in the API request and then parse the response to extract the last update date.

<?php
$domain = "example.com";
$api_key = "YOUR_API_KEY";

$url = "https://api.whoisapi.com/whois/check?apikey=$api_key&domain=$domain";
$response = file_get_contents($url);
$data = json_decode($response, true);

if(isset($data['last_updated'])){
    $last_update_date = $data['last_updated'];
    echo "Last Update Date: $last_update_date";
} else {
    echo "Error retrieving last update date.";
}
?>