I have a variable generated by $_POST
called $quantity
,
What would be the correct way to run a loop based on the value of this variable?
I have a variable generated by $_POST
called $quantity
,
What would be the correct way to run a loop based on the value of this variable?
Well, assuming that $quantity
is numerical, you can do this:
for ($c = 0; $c < $quantity; $c++) {
//do whatever
}