I am currently going through the PHP manual and I am having a problem reading the description. For example on this array_slice
method description:
array array_slice ( array $array , int $offset [, int $length = NULL [, bool $preserve_keys = false ]] )
or maybe a simple one of substr
:
string substr ( string $string , int $start [, int $length ] )
I do not understand the [,
that comes after $offset
and NULL
. Where can I read on this or what does the [,
mean and how do you read it?
The [ ]
usually show optional parameters. So the [,
is saying you could, but don't have to do array_slice($array, $offset, $length)
the $length
parameter is optional.
You could only do array_slice($array, $offset)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With