Can PHP be used to dynamically display different HTML pages based on user interaction?

Yes, PHP can be used to dynamically display different HTML pages based on user interaction. One way to achieve this is by using conditional statements in PHP to determine which HTML page to display based on user input or other criteria.

<?php
// Assume $userInput is the user input or criteria used to determine which HTML page to display

if ($userInput === 'option1') {
    include 'page1.html';
} elseif ($userInput === 'option2') {
    include 'page2.html';
} else {
    include 'default.html';
}
?>