I have this problem but I don't know how to name it, for instance, I have this function,
function test($param1,$param2 = false,$param3 = false)
{
if($param2 == true)
{
return '2';
}
elseif($param3 == true)
{
return '3';
}
else
{
return '1';
}
}
In order to return '3', I have to evoke my function like this,
$test = test('test',false,true);
I want to ask whether I can skip the second param and return '3' by evoking the function like this?
$test = test('test',$param3 = true);
Or any other method to do so?