How can the issue of redefining constants be avoided when including multiple files in PHP?

When including multiple files in PHP, the issue of redefining constants can be avoided by using the `defined()` function to check if a constant has already been defined before defining it again. This ensures that constants are only defined once, preventing any conflicts or errors.

// File1.php
if (!defined('MY_CONSTANT')) {
    define('MY_CONSTANT', 'some value');
}

// File2.php
if (!defined('MY_CONSTANT')) {
    define('MY_CONSTANT', 'another value');
}