Re: Creating optional arguments



Mazin07 wrote:
Let's say I have

function dosomething ($var1, $var2, $var3) {

    ...

}

How do I make $var3 optional so that I can pass only 2 arguments and still have it work?


function dosomething($var1, $var2, $var3='somevalue'){
	..
}
.