Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
188 views
in Technique[技术] by (71.8m points)

unable to understand php online manual

I was trying to find help from the PHP manual (http://de2.php.net/manual/en/function.array-multisort.php) but the description syntax for parameters is too complex, like

  bool array_multisort ( array &$array1 [, mixed $array1_sort_order = SORT_ASC [, mixed   $array1_sort_flags = SORT_REGULAR [, mixed $... ]]] )

I know that the parameters are there described, like:

array1

An array being sorted.

array1_sort_order

The order used to sort the previous array argument. Either SORT_ASC to sort ascendingly or SORT_DESC to sort descendingly.

but what's the meaning of that description and square brackets?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The parameters between brackets are optional parameters

I will explain a little to clarify:

bool array_multisort ( array &$array1 [, mixed $array1_sort_order = SORT_ASC [, mixed   $array1_sort_flags = SORT_REGULAR [, mixed $... ]]] )

Params:

  • array &$array1: This is the first paramter and is obligatory (not in square brackets), and is the array you want to sort.

  • mixed $array1_sort_order = SORT_ASC: The second parameter, this is sort order and is an optional parameter, if you don't specify then the default value is SORT_ASC

And so on...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...