Re: Differences in arrays
| From: | Mike Smith | Date: | Thu, 02 Dec 2004 11:54:31 +0000 |
| Subject: | Re: Differences in arrays | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203333@lists.php.net to get a copy of this message | ||
> Yes, I did that and it works correctly now. I was
> tryin g to better understand why the difference in the
> behaviour.
>
> Stuart
The first array is created by selecting individual elements from a
muli-select list
(My multi-select is a little hazy, but I think it's something like...)
<select multiple>
<option>One</option> (Selected)
<option>Two</option>
<option>Three</option> (Selected)
<option>Four</option>
</select>
...would create a 2 element array. The second array is created by the
rendered objects. I'm guessing you created text fields like:
<input type="text" name="schools[]">
<input type="text" name="schools[]">
<input type="text" name="schools[]">
...That creates an array with 3 values, empty until the user types
something, upon POST (or GET) of the form.