How can global constants be defined in PHP scripts to ensure availability across all included files?
Global constants in PHP can be defined using the `define()` function at the beginning of a script. To ensure availability across all included files, these constants should be defined in a separate file that is included in all other PHP scripts using `require_once` or `include_once`. This way, the constants will be accessible globally throughout the application.
// constants.php
define('SITE_NAME', 'My Website');
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASS', 'password');
// index.php
require_once 'constants.php';
echo SITE_NAME;
// Output: My Website