It's pretty standard syntax. Anything inside  is an optional component, but that component must be taken as a whole.
function1(string $imrequired[,string $imnot[,string $...],int $anumber])
Should be read as: "Needs 1 string. May have a second string, followed by 0 or more strings, and then a number."
The function may have:
1 parameter (string imrequired) function1("Haha")
3 parameters (string imrequired, string imnot, and int anumber) function1("Haha","Nope",3)
4+ paramters (string imrequired, string imnot, 1 or more string $..., and int anumber) function1("AString","BString","CString",9000)
If the comma were outside the , it would be required, and thus the syntax would be function1("Haha",) , which makes no sense.