What are the advantages of storing configuration settings directly as an associative array in a file in PHP?

Storing configuration settings directly as an associative array in a file in PHP can make it easier to manage and access these settings throughout your application. By storing them in a single file, you can easily update or modify the settings without having to search through multiple files. Additionally, using an associative array allows you to organize the settings in a structured format, making it more readable and maintainable.

// config.php
return [
    'database' => [
        'host' => 'localhost',
        'username' => 'root',
        'password' => 'password',
        'database_name' => 'my_database'
    ],
    'app' => [
        'debug' => true,
        'timezone' => 'UTC'
    ]
];