|
|
|
|
|
by frosas
5083 days ago
|
|
I agree keyword arguments are a better solution (but probably harder to implement). Right now this is how I do this: function salute($user, array $options = null) {
$options = (array) $options + array('shout' => false);
$salutation = "Hi $user!";
if ($options['shout']) $salutation = strtoupper($salutation);
return $salutation;
}
|
|