Array in Form Elements
| From: | Jason Lotito | Date: | Wed, 28 Mar 2001 03:06:29 +0000 |
| Subject: | Array in Form Elements | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45796@lists.php.net to get a copy of this message | ||
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.