how to pass an array in GET in PHP?

后端 未结 12 980
萌比男神i
萌比男神i 2020-11-28 14:37
$idArray = array(1,2,3,4);

can I write this line in HTML?

12条回答
  •  青春惊慌失措
    2020-11-28 14:55

    Felix's answer answers the question beautifully, but lacks the examples in my opinion.

    This answer is prompted by the comment on Felix's answer.

    can you specify keys using this method? – Qwerty Apr 27 '14 at 0:05

    First off, to illustrate Felix's answer:

    
    
    
    

    When the request is sent to the server it will be of the type Array.

    Following is an example with keys. This will give you an array with two keys, two values each.

    
    
    
    
    

    Finally here's an example with VueJS, which is what I was using as of this writing, which led me to this question.

    
    

    I hope this will be helpful to any passersby.

提交回复
热议问题