What are the best practices for including PHP files in a script to avoid unexpected errors?

When including PHP files in a script, it is important to follow best practices to avoid unexpected errors. One common issue is including the same file multiple times, which can lead to redeclaration errors. To prevent this, you can use the `require_once` or `include_once` functions to ensure that the file is only included once in the script.

// Correct way to include a PHP file to avoid redeclaration errors
require_once 'file.php';