What are some best practices for structuring configuration files in PHP projects?

When structuring configuration files in PHP projects, it is important to separate sensitive information such as database credentials from the main codebase for security reasons. One common approach is to use a separate configuration file (e.g., config.php) that contains all the necessary settings and variables. This file can then be included in other PHP files where the configuration is needed.

// config.php

define('DB_HOST', 'localhost');
define('DB_USER', 'username');
define('DB_PASS', 'password');
define('DB_NAME', 'database_name');
```

This configuration file can then be included in other PHP files like this:

```php
// index.php

require_once 'config.php';

// Use the defined constants here
$conn = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);