I know that you can use optional arguments as follows:
function doSomething($do, $something = "something") {
}
doSomething("do");
doSomething("do", "nothing");
But suppose you have the following situation:
function doSomething($do, $something = "something", $or = "or", $nothing = "nothing") {
}
doSomething("do", $or=>"and", $nothing=>"something");
So, in the above line, the default will be $something“something”, although I set the values for everything else. I know this is possible in .net - I use it all the time. But I need to do this in PHP, if possible.
- , ? Omnistar, Interspire, , , , ( ) . , .