What is the purpose of the include function in PHP?
The include function in PHP is used to include and evaluate the specified file during the execution of a script. This is useful for reusing code across multiple files, such as header or footer sections. It helps to keep code organized and maintainable by separating different parts of the code into separate files.
<?php
include 'header.php';
// Code for the main content
include 'footer.php';
?>