Passing arrays from HTML form to PHP

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

This is the HTML:

 do 
<
3条回答
  •  渐次进展
    2021-01-25 18:50

    Combined array: array_map(null,$_POST['shortcut'],$_POST['ses']);

    But you could of course could foreach over one of the 2, and fetch the other by key.

    Note that if you have elements which may or may not be sent (checkboxes for instance), the only way to keep groups together is to assign them a number beforehand (name=sess[1], name=sess[2], etc.)

提交回复
热议问题