How can PHP be used to load the header, footer, and navigation only once on a webpage?

When building a webpage with PHP, you may want to load common elements like the header, footer, and navigation only once to avoid redundancy and make the code more maintainable. One way to achieve this is by using include or require statements to load these elements from separate files. By including these files at the beginning of the main page, you can ensure that they are loaded only once and displayed consistently across the entire website.

<?php
include 'header.php';
include 'navigation.php';
?>

<!-- Main content of the webpage goes here -->

<?php
include 'footer.php';
?>