Multiple inputs with same name through POST in php

后端 未结 5 2123
误落风尘
误落风尘 2020-11-22 02:54

Is it possible to get multiple inputs of the same name to post and then access them from PHP? The idea is this: I have a form that allows the entry of an indefinite number

5条回答
  •  别跟我提以往
    2020-11-22 03:10

    For anyone else finding this - its worth noting that you can set the key value in the input name. Thanks to the answer in POSTing Form Fields with same Name Attribute you also can interplay strings or integers without quoting.

    The answers assume that you don't mind the key value coming back for PHP however you can set name=[yourval] (string or int) which then allows you to refer to an existing record.

提交回复
热议问题