: This article mainly introduces the first blog post: Why is this option written in the PHP function prototype ?, If you are interested in the PHP Tutorial, refer. The first article is the beginning. Write something simple.
When I first started learning PHP, I encountered a problem when I was reading PHP Manual: in the function prototype with optional parameters, the optional parameter writing cannot be understood.
Example: explode function
Array explode (string $ delimiter, string $ string [, int $ limit])
If the optional parameters are enclosed by [square brackets], the third parameter $ limit is optional.
But why not:
Array explode (string $ delimiter, string $ string, [int $ limit])
The location of this comma cannot be understood.
The above introduces the first blog article: Why is the optional parameter writing in the PHP function prototype written like this ?, Including some content, hope to be helpful to friends who are interested in PHP tutorials.