How can HTML elements be properly integrated within a PHP switch/case statement?

When integrating HTML elements within a PHP switch/case statement, you can use echo statements to output the HTML code based on the specific case. Simply enclose the HTML code within the echo statement and concatenate any PHP variables or expressions as needed to dynamically generate the HTML content.

<?php
$fruit = "apple";

switch ($fruit) {
    case "apple":
        echo "<p>This is an apple.</p>";
        break;
    case "banana":
        echo "<p>This is a banana.</p>";
        break;
    default:
        echo "<p>Fruit not recognized.</p>";
}
?>