Re: Basic multi-dimensional array help
| From: | Chris Anderson | Date: | Tue, 03 Jul 2001 16:43:36 +0000 |
| Subject: | Re: Basic multi-dimensional array help | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56012@lists.php.net to get a copy of this message | ||
When I wanted multi-dimensional with forms, I think I had to do this:
<INPUT NAME=var[0][]>
----- Original Message -----
From: "Wieger Uffink" <wieger@usmedia.nl>
To: "Jeff Gannaway" <webmaster@cactusgraphics.com>
Cc: <php-general@lists.php.net>
Sent: Tuesday, July 03, 2001 8:32 AM
Subject: Re: [PHP] Basic multi-dimensional array help
> Hi Jeff,
>
> There probably are several ways of doing this.
>
> One is you copy $info[0] ( an array itself ) into a dummy variable, and
> get the values with $dummy[0] etc.
> Or use brackets in your variable syntax, which youll have to experiment
> with cause, I can never seem to remeber the right syntax :)
>
> something like ${$info[0]}[0] I think... correct me if Im wrong.
>
> Hope this helps,
> Wieger
>
> Jeff Gannaway wrote:
> >
> > I've got input fields in a form that look like:
> > <INPUT TYPE=HIDDEN NAME=Person[0] VALUE=Jeff>
> > <INPUT TYPE=CHECKBOX NAME=Info[0][] VALUE=Apples>
> > <INPUT TYPE=CHECKBOX NAME=Info[0][] VALUE=Oranges>
> > <INPUT TYPE=CHECKBOX NAME=Info[0][] VALUE=Peaches>
> > <INPUT TYPE=CHECKBOX NAME=Info[0][] VALUE=Pears>
> >
> > <INPUT TYPE=HIDDEN NAME=Person[1] VALUE=Carolyn>
> > <INPUT TYPE=CHECKBOX NAME=Info[1][] VALUE=Apples>
> > <INPUT TYPE=CHECKBOX NAME=Info[1][] VALUE=Oranges>
> > <INPUT TYPE=CHECKBOX NAME=Info[1][] VALUE=Peaches>
> > <INPUT TYPE=CHECKBOX NAME=Info[1][] VALUE=Pears>
> >
> > The next script processes all this into a database. Here are the results
I
> > get from various commands:
> >
> > sizeof($Info): 2
> > sizeof($Info[0]): 4
> > print $Info[0][0]: Array[0]
> >
> > Any help?
> > Jeff Gannaway
> >
> > ___________________________________________________________
> >
> > SUMMER ART PRINT SALE at www.PopStreet.com
> > Save an additional 10% off art print orders of $50 or more.
> > Type in coupon code jemc when checking out.
> > ___________________________________________________________
> >
> > Find the right art print for your home.
> > * Search by artist, color, art style and subject.
> > * Preview the art prints against your wall color.
> > * Specializing in contemporary, abstract and African
> > American art.
> > * Every day discounts on thousands of fine art prints.
> >
> > PopStreet.com is your avenue to art.
> >
> > http://www.popstreet.com
> > ___________________________________________________________
> > Coupon may be redeemed from June 27 through July 31, 2001.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
> --
> Wieger Uffink
> tel: +31 20 428 6868
> fax: +31 20 470 6905
> web: http://www.usmedia.nl
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>