What are the best practices for structuring a PHP website with header, navigation, content, and footer sections?

When structuring a PHP website with header, navigation, content, and footer sections, it is best practice to separate each section into its own PHP file for better organization and maintainability. You can then include these files in your main PHP file to build the complete webpage layout.

// header.php
<!DOCTYPE html>
<html>
<head>
    <title>Your Website Title</title>
</head>
<body>

// navigation.php
<nav>
    <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Contact</a></li>
    </ul>
</nav>

// content.php
<div>
    <h1>Welcome to Your Website</h1>
    <p>This is the main content of your website.</p>
</div>

// footer.php
<footer>
    <p>© <?php echo date("Y"); ?> Your Website Name</p>
</footer>

// index.php
<?php include 'header.php'; ?>
<?php include 'navigation.php'; ?>
<?php include 'content.php'; ?>
<?php include 'footer.php'; ?>

</body>
</html>