Possible Duplicate:
Any way to specify optional parameter values in PHP?
PHP function - ignore some default parameters
Suppose I have function like this:
function foo($name = "john", $surname = "smith") { ... }
And I am calling like this:
$test = foo("abc", "def");
Imagine now that I would like to skip the name and only use the surname, how is that achievable? If I only do $test = foo("def"); how can the compiler know I am referring to the surname and not to the name? I understand it could be done by passing NULL, but I need this for something more like this:
$test = foo($_POST['name'], $_POST['surname']);
Thanks in advance.