Let's say I've got a PHP function foo:
function foo($firstName = 'john', $lastName = 'doe') {
echo $firstName . " " . $lastName;
}
// foo(); --> john doe
Is there any way to specify only the second optional parameter?
Example:
foo($lastName='smith'); // output: john smith
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…