How can PHP be used to automate the display of domain names on a website with multiple domains?

To automate the display of domain names on a website with multiple domains, you can create an array of domain names and then use PHP to loop through the array and display each domain name on the website.

<?php
$domains = array("domain1.com", "domain2.com", "domain3.com");

foreach ($domains as $domain) {
    echo "<a href='http://$domain'>$domain</a><br>";
}
?>