PHP Function default parameter value
You can set default parameter value for method or function by giving it's initial value at argument declaration, see example:
function myFunc( $number = 8 ) { }
If client will pass a number to that function like myFunc( 11 ), then $number value will be 11. But if user will call it without argument or parameter, the $number variable will have value of
Comments
Post a Comment