To understand how works

ok on this site,

I found in description
string basename ( string $path [, string $suffix ] )

In example

echo "1) ".basename("/etc/sudoers.d", ".d").PHP_EOL;
echo "2) ".basename("/etc/passwd").PHP_EOL;
echo "3) ".basename("/etc/").PHP_EOL;
echo "4) ".basename(".").PHP_EOL;
echo "5) ".basename("/");

my question is (I hope not a silly one) why in the description the the square brackets started before the comma I expect it to be
string basename ( string $path, [string $suffix ] )

and not
string basename ( string $path [, string $suffix ] )

I find not user friendly for newbies.

Because the comma is needed only if it is added the other argument (in square brackets), otherwise no need to add comma.
So, the comma comes with that argument, which is optional.

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.

Thank You guys. All clear now!