How can PHP be used to dynamically load different content based on parameters in the URL without changing the address?

To dynamically load different content based on parameters in the URL without changing the address, you can use PHP to parse the URL parameters and then include the corresponding content based on those parameters. This can be achieved by using the $_GET superglobal to retrieve the parameters from the URL and then using conditional statements to include the appropriate content file.

<?php
// Retrieve the parameter from the URL
$param = $_GET['param'];

// Use a switch statement to include the corresponding content file
switch ($param) {
    case 'page1':
        include 'page1.php';
        break;
    case 'page2':
        include 'page2.php';
        break;
    // Add more cases for additional pages as needed
    default:
        include 'default.php';
        break;
}
?>