What are the differences between including a PHP file using the server variable $_SERVER['DOCUMENT_ROOT'] versus specifying the full path?
When including a PHP file using $_SERVER['DOCUMENT_ROOT'], the file path is relative to the root directory of the server, making it more portable and easier to maintain. On the other hand, specifying the full path can lead to issues if the file structure changes or when moving the code to a different server.
// Including a file using $_SERVER['DOCUMENT_ROOT']
include $_SERVER['DOCUMENT_ROOT'] . '/path/to/file.php';