What is the difference between using include and require in PHP?

The main difference between using include and require in PHP is how they handle errors. When using include, if the file being included is not found, a warning is issued and the script continues to execute. On the other hand, when using require, if the file being required is not found, a fatal error is issued and the script stops executing. It is recommended to use require when including essential files that are necessary for the script to run properly.

<?php
// Using require to include a file
require 'header.php';
?>