How can the EVA principle (Separation of Concerns) be applied to improve the structure of PHP code embedded in HTML output?

The EVA principle, which stands for Separation of Concerns, can be applied to improve the structure of PHP code embedded in HTML output by separating the PHP logic from the HTML presentation. This can be achieved by moving the PHP code to a separate file and including it in the HTML file using PHP include or require statements. By doing this, the code becomes more organized, easier to maintain, and adheres to the principle of separation of concerns.

// PHP code in separate file (logic.php)
<?php
// PHP logic here
$name = "John Doe";
?>

// HTML file (index.php)
<!DOCTYPE html>
<html>
<head>
    <title>Separation of Concerns Example</title>
</head>
<body>
    <h1>Welcome, <?php include 'logic.php'; echo $name; ?></h1>
</body>
</html>