note 17371 added to language.variables.scope
| From: | php at dynamicink dot com | Date: | Thu, 06 Dec 2001 08:34:39 +0000 |
| Subject: | note 17371 added to language.variables.scope | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-21661@lists.php.net to get a copy of this message | ||
regarding brunosjunk@hotmail.com's post of 15-Jun-2001 12:24 exclaiming: $LOCALS =
get_defined_vars();
And Vi-ola! Now there's a "$LOCALS" array.
This does not solely return local variables.
Querystrings, posts, cookies, etc. get sucked in as well. This is unfortunate as it makes being sure
a variable was defined in your script (local variable) a terrible process of elimination.
If anyone has a better way to this I would love to know:
if
(isset($memberaccess)&&!isset($HTTP_POST_VARS["memberaccess"])&&!isset($HTTP_GET_VARS["memberaccess"])&&!isset($HTTP_COOKIE_VARS["memberaccess"]))
{
echo "Yo, wussup world? How y'all membuz hangin'?!";
}
--
http://www.php.net/manual/en/language.variables.scope.php
http://master.php.net/manage/user-notes.php?action=edit+17371
http://master.php.net/manage/user-notes.php?action=delete+17371
http://master.php.net/manage/user-notes.php?action=reject+17371