how to create variable variables inside a for loop?
this is a loop:
for ( $counter = 1; $counter <= $aantalZitjesBestellen; $counter ++) {
}
inside this loop, I would like to create the $ seat variable every time it passes, but it should increase like this. the first time it should be $seat1 = $_POST['seat'+$aantalZitjesBestellen], the next time: $seat2 = $_POST['seat'+$aantalZitjesBestellen]etc.
so at the end it should be:
$seat1 = $_POST['seat1'];
$seat2 = $_POST['seat2'];
etc.
therefore, the variable and the contents of the variable $ _POST must be dynamic.
source
share