I have a form where the user can fill it and then if he need can add more field (I did it with js) by pushing a button. Now I would like to post via php the result but I don't know how to write the php side. I did try to follow directions in multi-dimensional array post from form but I could not sort it out. My html form:
<form role="form" method="POST" action="form.php">
<label>Ice Age Gelato</label>
<div class="multi-field-wrapper">
<div class="multi-fields"><div class="multi-field">
<input type="text" name="user[]">
<button type="button" class="remove-field">Remove</button>
</div></div>
<button type="button" class="add-field">Add field</button>
</div>
<input type="submit" value="Send">
</form>
And this the relative part in form.php that I don't know how to write:
$user = $_POST['users'] = array(
array()
);
and:
user: $user,
Where is wrong? Thank you