Passing data to function arguments
Posted: Mon Jan 23, 2006 11:47 am
Yo. I have a question about function arguments.
Let's say I have the following function:
Now, as you can see the argments $baz and $big have default values.
Let's I'd like to call the function, only altering the value of the arguments $bar and $bool:
Could that be done without passing information to the 2nd and 3rd arguments?
Let's say I have the following function:
Code: Select all
<?php
function foo($bar, $baz = "baz", $big = '', $bool = false)
{
//Some code is executed here.
//Note that ALL of the function arguments are used!
}
?>Let's I'd like to call the function, only altering the value of the arguments $bar and $bool:
Code: Select all
foo("bar", "baz", '', true);