Make Parameter Optional
Posted: Wed May 25, 2011 6:25 pm
How do I make a function parameter optional?
function I_am_a_function($first, $second = true){ // things }if no value is given for the second parameter, the code inside the function will see it as true.
I assume I can set = nulljacek wrote:Give it a default value in the definition
function I_am_a_function($first, $second = true){ // things }if no value is given for the second parameter, the code inside the function will see it as true.
unemployment wrote:yay... you can