Support for form arrays in browsers

I'm not even sure that formal arrays are the right term, but it looks something like this:

<input name='element[]' type='text' />
<input name='element[]' type='text' />

which is then retrieved in PHP as an array stored in $_POST['element']- in this case, with 2 values.

I tested it in the browsers that I have, but I have never seen this before, and I wonder if this is supported in many browsers? Or is it something very old that I just haven't come across?

Thank!

+3
source share
1 answer

This is a server-side language that turns this into an array (most languages ​​do not require the name to end in [], which is a PHP oddity).

, , . .

element[]=value&element[]=value

. , HTML form.

+9

Source: https://habr.com/ru/post/1743821/


All Articles