Form Submission
The "name" attribute
The name attribute in a form is the key of the data submitted to the server with the request (and the value the value).
hinweis
When we must submit multiple values with the same key we name each input field with square brackets []:
<input type="hidden" name="ingredients[]" value="5">
<input type="hidden" name="ingredients[]" value="9">
It tells the browser:
“When the form is submitted, collect all inputs with the same name (ingredients[]) into an array and send that array to the server.”
In PHP this becomes:
$_POST['ingredients'] = [5, 9];