What are the potential pitfalls of using relative paths in included files in PHP?
Using relative paths in included files in PHP can lead to issues when the file structure changes or when the file is included from a different directory. To avoid this, it is recommended to use absolute paths instead. This ensures that the included file will always be found regardless of the directory it is included from.
// Using absolute path to include a file
include_once(__DIR__ . '/path/to/file.php');