What are some alternative methods to include files in PHP besides the include function?

One alternative method to include files in PHP besides the include function is using the require function. The require function works similarly to include but will cause a fatal error if the file cannot be included, whereas include will only produce a warning. Another method is using the require_once function, which ensures that the file is included only once to prevent duplicate declarations.

// Using the require function
require 'filename.php';

// Using the require_once function
require_once 'filename.php';