Square brackets in HTML form arrays. Just conventional or with a meaning?

前端 未结 2 1958
再見小時候
再見小時候 2021-01-05 00:13

I frequently see, in particular in the PHP world, the following writing if you want to create a FORM array.




        
2条回答
  •  渐次进展
    2021-01-05 00:42

    It's just conventional.


    The W3C states:

    Let the form data set be a list of name-value-type tuples

    and for each input element, on submit:

    Append an entry to the form data set with name as the name, the value of the field element as the value, and type as the type.

    The W3C does not mention the use of [] or uniqueness of the name attribute.

提交回复
热议问题