PHP Iterate through $_POST and use values by name

前端 未结 4 1404
醉酒成梦
醉酒成梦 2021-02-05 05:14

I have a form that contains a number of fields with names item1, item2, item13, item43 etc, each time those fields are different because they are populated in the form with AJAX

4条回答
  •  梦毁少年i
    2021-02-05 06:05

    Try:

    foreach($_POST as $key=>$value){
        inserttag($key, $value);
    }
    

    $key will be the name of the element and $value will be the value.

提交回复
热议问题