3

From PHP manual:

array array_change_key_case ( array $array [, int $case = CASE_LOWER ] )

What does comma signify in a function definition?

11

Comma is a separator between parameters in the parameter list.

Comma is part of the parameter lists. Optional parameters are usually specified inside square brackets in documentation like so: [, int $case = CASE_LOWER]. Comma is added to specify that if you were to use the second optional parameter, you must have a comma separator as well.

The fact that comma is inside square brackets, means it's only required when you have more than one parameter.  

Another example with more optional parameters:

array array_change_key_case ( array $array [, int $case = CASE_LOWER [, string $myValue = '' ]] )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.