I have never done anything like this, and I would like to know how to do it. I need to put 4 inputs into a sub array if it is field out
I know that when i $_POST the form to the server it sends the names of the inputs but how do I get the input to be allowed to have the same name
for example
the sub array i need it to be in is offers
here is what i dont know. How do i get the following inputs
<input name="offers[]['minspend']" value="15.00"/>
<input name="offers[]['minspend']" value="5.00"/>
<input name="offers[]['minspend']" value="19.00"/>
<input name="offers[]['minspend']" value="8.00"/>
<input name="offers[]['minspend']" value="30.00"/>
<input name="offers[]['minspend']" value="7.00"/>
<input name="offers[]['minspend']" value="100.00"/>
<input name="offers[]['minspend']" value="10.00"/>
is this correct or wrong?
thanks
This form
on doing
var_dump($_POST)[assuming form method=post] give:So, that is how you do it.
you can remove
's around minspend. they aren’t needed.You were almost there.
offers[]['minspend']means that you get:So what is happening is, when you do something like
arr[] = 1,1is inserted into arrayarr.