Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameters in PHP documentation, squared brackets?

Tags:

function

php

This function for example...

int preg_match_all ( string $pattern , string $subject [, array &$matches [, int $flags = PREG_PATTERN_ORDER [, int $offset = 0 ]]] )

It takes the strings $pattern and $subject. However, what is [?

like image 739
Koray Tugay Avatar asked Dec 27 '22 11:12

Koray Tugay


1 Answers

That is how the documentation for a function indicates arguments that are optional

like image 94
Quentin Avatar answered Jan 09 '23 13:01

Quentin