What I’m trying to do:
- We have one input on the page
- We press “add” button and one more input adds after first
- On submit we get all their values and add them into an array.
How to add additional inputs on page (with jquery), and then get their contents in php?
You don’t need to add the inputs into an array explicitly. If you name the input fields correctly, PHP will automatically parse them into an array.
HTML
PHP