How can PHP scripts be structured to handle input parameters differently when run by Crontab versus a web server?

To handle input parameters differently when run by Crontab versus a web server, you can check if the script is being run from the command line using the `php_sapi_name()` function. Based on this check, you can then handle the input parameters accordingly in your PHP script.

if (php_sapi_name() === 'cli') {
    // Code to handle input parameters when running from Crontab
    $param1 = $argv[1];
    $param2 = $argv[2];
} else {
    // Code to handle input parameters when running from a web server
    $param1 = $_GET['param1'];
    $param2 = $_GET['param2'];
}

// Use $param1 and $param2 in your script accordingly