What is the purpose of using the include function in PHP?
The include function in PHP is used to include and evaluate a specified file during the execution of a script. This is useful for reusing code across multiple pages, separating code into more manageable files, and improving code organization. By using the include function, you can easily incorporate external files into your PHP script without having to rewrite the same code multiple times.
<?php
include 'header.php'; // Include the header file
// Your PHP code here
include 'footer.php'; // Include the footer file
?>