How can the PHP and HTML code in the provided script be better organized to improve readability and maintainability?

The PHP and HTML code can be better organized by separating the logic from the presentation. This can be achieved by using PHP to handle the backend logic and generating HTML output separately. By doing so, the code becomes more modular, easier to read, and maintain.

<?php
// Backend logic
$items = array("Apple", "Banana", "Orange");

// HTML output
?>
<ul>
    <?php foreach ($items as $item) : ?>
        <li><?php echo $item; ?></li>
    <?php endforeach; ?>
</ul>