Posting array from form

前端 未结 7 766
刺人心
刺人心 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条回答
  •  青春惊慌失措
    2020-11-27 06:03

    Give each input a name in array format:

    
    

    Then the in PHP $_POST['data']; will be an array:

      print_r($_POST);         // print out the whole post
      print_r($_POST['data']); // print out only the data array
    

提交回复
热议问题