What are the best practices for using define variables in PHP to prevent unauthorized access?

Using define variables in PHP is a good practice to store sensitive information like database credentials or API keys. To prevent unauthorized access to these variables, it's important to define them in a separate file outside of the web root directory. This way, they cannot be accessed directly by users through the browser.

```php
// config.php
define('DB_HOST', 'localhost');
define('DB_USER', 'username');
define('DB_PASS', 'password');
define('DB_NAME', 'database_name');
```

In this example, the sensitive database credentials are defined in a separate file called `config.php` which is stored outside of the web root directory. This ensures that the variables cannot be accessed directly by users.