Posting array from form

前端 未结 7 751
刺人心
刺人心 2020-11-27 05:45

I have a form on my page with a bunch of inputs and some hidden fields, I\'ve been asked to pass this data through a \"post array\" only im unsure on how to do this,

<
7条回答
  •  Happy的楠姐
    2020-11-27 06:08

    When you post that data, it is stored as an array in $_POST.

    You could optionally do something like:

    
    
    
    

    Then:

    $item1 = $_POST['arrayname']['item1'];
    $item2 = $_POST['arrayname']['item2'];
    $item3 = $_POST['arrayname']['item3'];
    

    But I fail to see the point.

提交回复
热议问题