How can the GET command be effectively used in conjunction with the include command in PHP?

When using the GET command in PHP to pass data through URLs, the include command can be effectively used to dynamically load different PHP files based on the data passed through the URL. This can be useful for creating modular and dynamic web applications where different content or functionality is loaded based on user input.

<?php
// Example of using GET and include command in PHP
$page = $_GET['page']; // Retrieve the page parameter from the URL

// Check if the requested page exists and include it
if (file_exists($page . '.php')) {
    include($page . '.php');
} else {
    echo 'Page not found';
}
?>