What is the recommended approach for passing parameters in URLs in PHP applications?

When passing parameters in URLs in PHP applications, it is recommended to sanitize and validate the input to prevent security vulnerabilities such as SQL injection or cross-site scripting attacks. One common approach is to use the `filter_input()` function to retrieve and sanitize input parameters from the URL.

// Retrieve and sanitize input parameter from the URL
$param = filter_input(INPUT_GET, 'param', FILTER_SANITIZE_STRING);

// Validate the input parameter
if ($param !== false) {
    // Use the sanitized parameter in your application logic
    echo "Parameter: " . $param;
} else {
    // Handle invalid input
    echo "Invalid parameter";
}