How can global variables be effectively utilized in PHP for email addresses?

Global variables can be effectively utilized in PHP for email addresses by storing the email address in a global variable and accessing it wherever needed in the code. This can help in avoiding repetitive declaration of the email address in multiple places and make it easier to update the email address in one central location.

<?php
// Set the global email address variable
global $email_address;
$email_address = "example@example.com";

// Access the global email address variable wherever needed
function send_email() {
    global $email_address;
    
    // Code to send email to $email_address
}

// Example usage
send_email();
?>