If you have the following function
function func1($captainObvious="John",$name){
return "Hallo my name is ".$captainObvious."<br>Welcome ".$name."!";
}
How do you call it with argument 2 without giving an argument 1?
I would like to call it with something like
func1(default,"Benny");
But I can’t seem find that possibility.
If you cannot change
func1, you will have to usefunc1("John", "Benny"). If you can change it but changing parameter order (the preferred solution!) is out of question because of legacy issues, you could usenullas default flag: