Passing function parameters
Posted: Fri Jul 17, 2009 1:22 am
Consider i have a function like this
When i call the function, I wanna pass values for the first and third parameters (i.e. for $a and $c) and $b has to take the default value.
Is it possible?
FYI
Sometimes i would wanna pass value for $b and sometime $c... So changing the position of the parameter wont work.
Code: Select all
function printValues($a,$b="Second",$c="Third") {
echo "$a -- $b -- $c";
}
Is it possible?
FYI
Sometimes i would wanna pass value for $b and sometime $c... So changing the position of the parameter wont work.