Can I use a generated variable name in PHP?

前端 未结 9 2179
梦谈多话
梦谈多话 2020-12-11 11:50

I have a bunch a values I would like to add together which are entered into a form. Right now, the form has 11 lines but it could get larger in the future. I can easily add

9条回答
  •  孤城傲影
    2020-12-11 12:35

    If you're trying to collect the values of a POST, you should really use an array. You can avoid having to manually piece together such an array by using:

    
    
    

    $_POST["vals"] will then be array("one", "two");

提交回复
热议问题