Put the default parameters at the end, then do not fill in the parameter in the function call.
Example:
function nums($c, $a = 1, $b = 2){
echo "$a, $b, $c";
}
nums(3);
The default parameters can be overridden by adding them to the function call:
function nums($c, $a = 1, $b = 2){
echo "$a, $b, $c";
}
nums(3, 12, 27);
source
share