What is the best practice for including header and footer files in PHP?

To include header and footer files in PHP, it is best practice to use the `include` or `require` function. This allows you to separate the header and footer code into separate files for easier maintenance and reusability. By including these files in your main PHP file, you can ensure that the header and footer are consistent across all pages of your website.

<?php
// Include header file
include 'header.php';

// Your main content goes here

// Include footer file
include 'footer.php';
?>