Forms / Array Question...
| From: | Noel Wade | Date: | Fri, 27 Jun 2003 18:20:28 +0000 |
| Subject: | Forms / Array Question... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-153187@lists.php.net to get a copy of this message | ||
Hi All,
Quickie Question... Possibly a silly one; but it would make my life easier if it works!
I know that with a SELECT MULTIPLE, you have to use the convention: NAME="$varName[]" to
get all of the responses into a nice neat array. I'm wondering about the mechanism behind this
- is it simply doing a behind-the-scenes "$varName[] = X;", "$varName[] = Y;",
"$varName[] = Z;".... operation to dynamically generate the array? (Note: this is not my
main question - keep reading. :-P )
If so, then it would follow that it's also possible to do something like this:
<INPUT TYPE="TEXT" NAME="$varArray[1]">
<INPUT TYPE="TEXT" NAME="$varArray[2]">
<INPUT TYPE="TEXT" NAME="$varArray[3]">
...
And get a nice array with your text values. Anyone know if this (A) works and (B) is not actually
just some undefined behavior that's risky to use?
Thanks! Take care,
--Noel