What are the potential pitfalls of using 'require' function with absolute paths in PHP?
Using 'require' function with absolute paths in PHP can lead to issues when moving the code to a different server or directory structure, as the absolute path may no longer be valid. To solve this issue, it is recommended to use relative paths instead of absolute paths when including files in PHP.
// Incorrect usage with absolute path
require '/var/www/html/includes/config.php';
// Correct usage with relative path
require 'includes/config.php';