<form method="post" action="arrayformdata.php">
<label>Tags</label>
<input type="text" name="tags[]" />
<input type="text" name="tags[]"/>
<input type="text" name="tags[]"/>
< input type="text" name="tags[]"/>
<input type="text" name="tags[]"/>
<input type="submit" value= "submit">
</form>
</html>
In this way, you can get all the values named tags[] through $_POST['tags'] in php and merge them into an array.
I don’t understand how it works
When submitting, you can see that the requested form information is
When PHP receives this information, it will pass the variables into the current script in the form of an associative array. Since it is an associative array, there will be keys, and the tags[] above are the same set of keys. PHP will put them into an array when processing.
I think it should be the same as this. It's because the PHP side does the processing (I don't know about other back-end languages). Because what was sent to the front desk is like this, as shown in the picture
Same meaning as above, all input boxes submitted are assigned to $_POST, $_POST is a super global variable, so it can be received anywhere