note 34717 added to reserved.variables
| From: | sheri_ellis at yahoo dot com | Date: | Tue, 05 Aug 2003 04:30:29 +0000 |
| Subject: | note 34717 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-53379@lists.php.net to get a copy of this message | ||
Global arrays retrieved from $_POST have their names changed by the system so that the first letter
is capitalized. It doesn't matter whether the array was in all caps or all lowercase. In my
case, I was trying to set an array to select multiple:
if ($page==1) { //displaying the form to grab user input
global $family
echo "<form action=search.php?page=2 method=POST>";
Family: <select name="Family[]" size=2 multiple>
<option value=1>Hatfields</option>
<option value=2>McCoys</option>
...}
if ($page==2) { //parsing the user input
while(list($k,$v)=each($family)) { //wouldn't work
echo "$k => $v,\n";
}
I had to refer to the array as $Family. Knowing this would've saved me hours!! I'm a
relative newbie to PHP, so maybe it's a no-brainer for you gurus, but.... WAAAAH!!! :) Ok,
turning rant off. Thanks for listening!
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34717
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34717&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34717&report=yes