What are some best practices for consolidating multiple config.php files into a single file for easier maintenance in PHP development?

When working on a PHP project with multiple config.php files scattered throughout the codebase, it can become difficult to manage and update configurations consistently. To streamline maintenance, it's best practice to consolidate all configuration settings into a single config.php file. This centralizes all configuration variables in one place, making it easier to update and maintain.

// config.php

$config = [
    'db_host' => 'localhost',
    'db_user' => 'root',
    'db_pass' => 'password',
    'db_name' => 'database',
    'site_url' => 'http://example.com'
];

// usage example
echo $config['db_host'];