note 16196 added to ref.array
| From: | jhilgeman at php2 dot chek dot com | Date: | Fri, 19 Oct 2001 17:06:43 +0000 |
| Subject: | note 16196 added to ref.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-19160@lists.php.net to get a copy of this message | ||
If you're using the form --> array trick, (<INPUT NAME='MyForm[MyVar]'>),
make sure you do not put quotes around the variable name inside the brackets:
Incorrect:
<INPUT NAME='MyForm["MyVar"]'>
Correct:
<INPUT NAME='MyForm[MyVar]'>
The quotes will cause the actual index of the array to contain quotes and you have to take them out
before being able to access the array item. i.e. :
After using the incorrect method:
$MyForm["MyVar"] will not work because PHP is thinking that the quotes are special
characters, not part of the index's name.
Using the correct method will result in the existence of $MyForm["MyVar"]
-- Jonathan
--
http://www.php.net/manual/en/ref.array.php
http://master.php.net/manage/user-notes.php?action=edit+16196
http://master.php.net/manage/user-notes.php?action=delete+16196
http://master.php.net/manage/user-notes.php?action=reject+16196