Re: array question
| From: | Philip Olson | Date: | Wed, 30 Oct 2002 17:21:27 +0000 |
| Subject: | Re: array question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122059@lists.php.net to get a copy of this message | ||
A very important question indeed :)
<form method='POST'...
<input type="text" name="interests[]">
<input type="text" name="interests[]">
print $_POST['interests'][0];
print $_POST['interests'][1];
<input type="text" name="interests[foo]">
<input type="text" name="interests[bar]">
print $_POST['interests']['foo'];
print $_POST['interests']['bar'];
Read the manual section on arrays for more
information on using them.
http://www.php.net/manual/en/language.types.array.php
Regards,
Philip
On Wed, 30 Oct 2002, Rick Emery wrote:
> What does you HTML look like?
> ----- Original Message -----
> From: "John Meyer" <johnmeyer_1978@yahoo.com>
> To: <php-general@lists.php.net>
> Sent: Wednesday, October 30, 2002 10:36 AM
> Subject: RE: [PHP] array question
>
>
> Either way, I'm not getting the interests.
>
> -----Original Message-----
> From: Rick Emery [mailto:remery@emeryloftus.com]
> Sent: Wednesday, October 30, 2002 9:34 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] array question
>
>
> What happened when you tried both methods?
>
> ----- Original Message -----
> From: "John Meyer" <johnmeyer_1978@yahoo.com>
> To: <php-general@lists.php.net>
> Sent: Wednesday, October 30, 2002 10:29 AM
> Subject: [PHP] array question
>
>
> When retrieving an array from $_POST, which is the right way:
>
> $arrInterests = $_POST["interests[]"];
>
> or
> $arrInterests = $_POST["interests"];
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>