Passing arrays from HTML form to PHP

前端 未结 3 1559
旧时难觅i
旧时难觅i 2021-01-25 18:00

This is the HTML:

 do 
<
3条回答
  •  逝去的感伤
    2021-01-25 18:29

    The indexes are connected automatically, since they're numeric arrays.

    $nvals = count($_REQUEST['shortcut']);
    for ($i = 0; $i < $nvals; $i++) {
      // do something with $_REQUEST['shortcut'][$i] and $_REQUEST['ses'][$i]
    }
    

提交回复
热议问题