What are the differences between include and require functions in PHP?

The main difference between include and require functions in PHP is how they handle errors. If the file being included is not found, include will only produce a warning and continue executing the script, while require will produce a fatal error and stop the script. Use include when the file is not crucial for the script to run, and use require when the file is essential for the script to work correctly.

// Using include function
include 'file.php';

// Using require function
require 'file.php';