Re: Array in Form Elements
| From: | Jack Dempsey | Date: | Wed, 28 Mar 2001 01:09:26 +0000 |
| Subject: | Re: Array in Form Elements | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45803@lists.php.net to get a copy of this message | ||
<input name="array[]" type="text">
i used something like this in a series of checkbox's to grab all the
values in an array....i'm not sure if it can be used in this way though,
but give it a go...
-jack
Jason Lotito wrote:
>
> Okay, here is the question, I have a form that will continue to grow in the
> number of elements that it contains. The values are passed into a function,
> and then written out to a file.
>
> Currently, I have 38 seperate values that are being passed into this
> function, making the arguments for the function very long. Now, I know I
> can pass an array into a function, however, I would like to know if there
> was a way to name the elements of the form as in an array, for example:
>
> <input name="array[1]" type="text">
> <input name="array[2]" type="text">
> <input name="array[3]" type="text">
> <input name="array[4]" type="text">
>
> and then, rather than having to pass all 38 seperate arguements into the
> function, I could simply pass the array like this:
>
> function_name($array);
>
> And then simply dissect the array inside the function like normal?
>
> Thanks
>
> Jason Lotito
> www.NewbieNetwork.net
> Where those who can, teach;
> and those who can, learn.
>
> --
> 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