How can PHP be used to create a footer with a mailto contact link for all articles on a website?

To create a footer with a mailto contact link for all articles on a website using PHP, you can create a PHP function that generates the footer with the mailto link dynamically. This function can be included at the end of each article page to display the footer with the contact link.

<?php
function generateFooter($email) {
    echo "<footer>";
    echo "<p>Contact us at <a href='mailto:$email'>$email</a></p>";
    echo "</footer>";
}

// Include this function at the end of each article page
generateFooter("contact@example.com");
?>