On Tue, 6 Feb 2001 08:57, April wrote:
> I have a form that is an extended version of this:
>
> <form>
> <input type="text" name="email[1]">
> <input type="text" name="email[2]">
> <input type="text" name="email[3]">
> </form>
>
> Unfortunately, the email[1] part was generated using a variable in a
> loop. I have no idea how many of these fields there really will be each
> time this is done.
>
> I then need to turn around and, while processing the form, extract the
> values for each field in another loop.
> Trying to do echo $email[$i] doesn't seem to work, though.
>
> Is my entire logical approach wrong? Could it be something wrong with
> syntax? Is it not possible to use a variable as the inner part of an
> array like that? ooo, or best one to answer: does someone have a
> snippet of code doing what I want to do here, that I could learn from?
Have a look at the functions list and each - there are code snippets in the
manual which should give you some ideas for getting the values and keys
from an array. You might also be interested in count and sizeof for
determining the number of elements in the array.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]