On Wed, Sep 19, 2001 at 07:56:28PM +0900, TAKAHASHI Masayoshi wrote:
> matz / ruby-lang.org (Yukihiro Matsumoto) wrote:
> > Then what if there are multiple values for a form name, for example:
> > 
> >   GET /script.cgi?user_var=foo&user_var=bar HTTP/1.1
> >   Host: www.example.com
> >   Connection: close
> > 
> > What should be returned for cgi.request["user_var"]?  Possible
> > solution can be any of:
> > 
> >   * "foo\0bar"      (Perl's cgi-lib.pl and cgi-lib.rb)
> >   * ["foo", "bar"]  (cgi.rb)
> >   * #<FieldStorage> (Python's cgi.py)
> >   * or something else
> 
>     * "bar"           (PHP4)
> 
> But when you use "[]" as variable name, like
> "/script.cgi?user_var[]=foo&user_var[]=bar", you get:
> 
>     * ["foo", "bar"]  (PHP4)

You can also do
"/script.cgi?user_var[1][1]=a&user_var[1][2]=b&user_var[2][1]=c&user_var[2][2]=c"

and you get:
	
	[["a", "b"], ["c", "d"]]

in PHP4. This can be very usefull sometimes

greetings, Florian Pflug