Are there any best practices for creating universal PHP scripts that can accept parameters?

When creating universal PHP scripts that can accept parameters, it is important to use functions and parameters effectively to make the script flexible and reusable. One best practice is to define default parameter values in case they are not provided by the user. This ensures that the script can still run without errors even if certain parameters are not specified.

<?php

function greet($name = "Guest") {
    echo "Hello, $name!";
}

// Call the function with a specified name
greet("John");

// Call the function without specifying a name (default value will be used)
greet();

?>