Re: Multiple selections
| From: | Ernest E Vogelsinger | Date: | Wed, 13 Nov 2002 07:37:16 +0000 |
| Subject: | Re: Multiple selections | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-124177@lists.php.net to get a copy of this message | ||
At 02:06 13.11.2002, Todd Cary said:
--------------------[snip]--------------------
>Many thanks!! One thing I do not understand in the "types" of variables
>is the use and referencing of a variable with the "[]". What I usually do
>is define a variable as
>
>$myvar = array();
>
>And then I use the "[]" to refer to the elements. However, if I
>understand you suggestion, which works like a champ, the use of the "[]"
>tells the interpreter to treat $myvar as an array.
-------------------[snip]--------------------
No. The '[]' doesn't have to do with a PHP variable, it only tells PHP to
treat an _incoming_ parameter as an array.
What happens when PHP parses form data is something like:
variable is named "name"[] ?
yes - $_REFERENCE['name'] = array(v1, v2, v3);
no - $_REFERENCE['name'] ? v1;
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/