Re: $_POST, $_GET and $_REQUEST discarding duplicates [message #170806 is a reply to message #170803] |
Sat, 27 November 2010 18:53 |
Michael Fesser
Messages: 215 Registered: September 2010
Karma:
|
Senior Member |
|
|
.oO(Luuk)
> On 27-11-10 08:17, Thomas 'PointedEars' Lahn wrote:
>>
>> <… name="verb[]" …>
>>
>> will get you
>>
>> array(1) {
>> ["verb"]=>
>> array(…) {
>> …
>> }
>> }
>>
>> It is a very old "problem", to be found discussed in a great many PHP FAQs.
>> Please do search next time.
>
> Can you point us to these FAQ's?
See questions 3 and 4 on
http://www.php.net/manual/en/faq.html.php
> When i tested, i got the following response:
>
> test.php?a=12&a=12
>
> response:
> array(1) { ["a"]=> string(2) "12" }
>
> so, OP seems to be right that the second parameter gets dropped.
No.
> but when i test with:
> test.php?a=12&a=13
>
> i get:
>
> array(1) { ["a"]=> string(2) "13" }
>
> so, in fact it looks more like the last parameters survives....
Correct, because the second value overrides the first one. If you want
to receive both in your script, make them an array with the syntax
already mentioned.
Micha
|
|
|