Yes, as I stated in my previous post as well, this *definitely* need
to be changed to follow the array name with brackets, otherwise you
are simply redefining that variable over and over again and it will
simply equal the last value. Maybe rails handles this correctly but
probably nothing else will and it simply isn't correct.  I thought we
all knew that to make an array in a query string you use []?

A simple test of the 1.5.1_rc1 code shows that
$H({blah:['foo','bar']}).toQueryString() => "blah=foo&blah=bar"

If you paste this into my test page [1] you will see that php gets:
[blah] => bar

The correct result of the above toQueryString should be:
Which will yield:
[blah] => Array (
  [0] => foo
  [1] => bar

Did anyone read my first post to this thread? I make some very good
points there but they seem to have been completely ignored thus far.



On Mar 14, 8:06 am, "Richard Quadling" <[EMAIL PROTECTED]>
> On 13/03/07, Mislav Marohnić <[EMAIL PROTECTED]> wrote:
> > "foo=a&foo=b&foo=c" becomes { foo:['a', 'b', 'c'] }. Rails (PHP too, I
> > think) would preserve only the first value. Ruby preserves all.
> In PHP, this would end up as
> array(1) { ["foo"]=>  string(1) "c" }
> $_GET is an array of 1 element with an index of 'foo' with a value of 'c'.
> > "foo[]=a&foo[]=b&foo[]=c" becomes { 'foo[]':['a', 'b', 'c'] }. Rails and PHP
> > would now preserve all values, but remove the square brackets from the key.
> In PHP, this would end up as
> array(1) { ["foo"]=>  array(3) { [0]=>  string(1) "a" [1]=>  string(1)
> "b" [2]=>  string(1) "c" } }
> $_GET is an array of 1 element with an index of 'foo' which is an
> array of 3 elements, 'a', 'b' and 'c'.
> If you have PHP, use this as showget.php
> <?php var_dump($_GET); ?>
> --
> -----
> Richard Quadling
> Zend Certified Engineer :
> "Standing on the shoulders of some very clever giants!"

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to