variable variables

后端 未结 5 1066
醉话见心
醉话见心 2020-11-28 16:54

how do i create variable variables inside a for loop?

this is the loop:

for ( $counter = 1; $counter <= $aantalZitjesBestellen; $counter ++) {

}         


        
5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-28 17:42

    This will work as well:

    for ( $counter = 1; $counter <= $aantalZitjesBestellen; $counter ++) {
        ${'seat' . $counter} = $_POST['seat' . $counter];
    }
    

提交回复
热议问题