Home  >  Article  >  Backend Development  >  The first blog post: Why are the optional parameters in the PHP function prototype written this way?

The first blog post: Why are the optional parameters in the PHP function prototype written this way?

WBOY
WBOYOriginal
2016-08-08 09:19:19859browse

The first article is the beginning. Simply write something.

I just started learning PHP and encountered a problem when reading the PHP Manual: In the function prototype containing optional parameters, the optional parameters are not written in a way that I can understand.

For example, the explode function

<span>array explode ( string $delimiter , string $string [, int $limit ] )
</span>

optional parameters are enclosed in "[square brackets]", then the third parameter $limit is an optional parameter.

But why not write it like this:

<span>array explode ( string $delimiter , string $string ,[int $limit ] )
</span>

I really can’t understand the position of this comma.

The above introduces the first blog post: Why are the optional parameters in the PHP function prototype written like this? , including relevant content, I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn