Is there a way to make a function's input variable be optional?
So instead of having to put functionname(''), functionname() would work?
Printable View
Is there a way to make a function's input variable be optional?
So instead of having to put functionname(''), functionname() would work?
Nevermind! Found it in the manual:
Code:function funcname($param = "default") {
return $param;
}
funcname();
funcname("fun");