Hi,
I'm having here a problem with a function that uses default values. I declared a function like this:
PHP Code:
function _subtractresources($townid, $towntype, $wood = 0, $stone = 0, $metal = 0) {
As you can see I am using default values on the last three arguments.
Now how can I run the functions while, for example, only putting the townid, towntype and stone arguments? I tried something like this...
PHP Code:
_subtractresources($idtown, $typetown, , 300, )
I thought of it because you could also do it on a for(;$x < 5; ) .
But it doesn't works, also if I erase the last comma ' , '. Instead I get something like: Parse error: syntax error, unexpected ',' in C:\My\Path\To\It\some_file.php on line 89.
Can anyone tell me on how to do it? In the last case I fill in all the blank spaces with 0.
Thanks in advance,
Schimassek...
|