How can constants be used effectively in PHP to manage configuration settings?

Constants can be used effectively in PHP to manage configuration settings by defining key configuration values as constants. This makes the configuration settings easily accessible throughout the application and ensures that they cannot be changed accidentally. Constants are defined using the `define()` function and can be accessed using their names without the need for a dollar sign.

// Define configuration constants
define('DB_HOST', 'localhost');
define('DB_USER', 'username');
define('DB_PASS', 'password');
define('DB_NAME', 'database_name');

// Access configuration constants
echo DB_HOST;
echo DB_USER;
echo DB_PASS;
echo DB_NAME;