What is the best way to assign default arguments to function variables when the default is taken from the value of another function.
Example:
I would like to do the above, but it does not work.PHP Code:function function($startDate = time()) {
echo $startDate;
}
function();
Do you have to test for $startDate inside the function and then set it to time() if it is null? Or is there a better way?
Thanks.



Reply With Quote

Bookmarks