What are the differences between absolute and relative paths in PHP file inclusion?

When including files in PHP, you can use absolute paths or relative paths. Absolute paths start from the root directory of the file system, while relative paths are based on the current working directory. Using absolute paths can ensure that the correct file is included regardless of the current working directory, while relative paths are more flexible and easier to manage within a project.

// Absolute path inclusion
include '/var/www/html/includes/header.php';

// Relative path inclusion
include 'includes/header.php';