What are the best practices for structuring HTML, PHP, and JavaScript code in a web page to ensure proper functionality and readability?

To ensure proper functionality and readability in a web page, it is important to separate the HTML, PHP, and JavaScript code into distinct sections. This can be achieved by using proper indentation, comments, and organizing the code logically. Additionally, it is recommended to use external files for JavaScript and CSS to keep the code clean and maintainable.

<!DOCTYPE html>
<html>
<head>
    <title>My Web Page</title>
    <link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
    <header>
        <h1>Welcome to My Web Page</h1>
    </header>
    
    <div class="content">
        <p>This is the main content of the page.</p>
    </div>
    
    <footer>
        <p>© 2022 My Web Page</p>
    </footer>
    
    <script src="script.js"></script>
</body>
</html>