test for undefined variables & renaming variables
| From: | August Malson | Date: | Thu, 08 Feb 2001 07:11:33 +0000 |
| Subject: | test for undefined variables & renaming variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-38667@lists.php.net to get a copy of this message | ||
Q:
Does anyone know of a way to test for undefined variables? For example, I
am sending a variable into the page, but the processing of the page depends
on what is being passed to the page.
Say, I am typing the following on the location bar:
index.php?fuseaction=something&fuse=6
and I want something to happen if fuse is actually declared, and something
else to happen if fuse is not defined.
I have tried isdef(), but that function does not seem to work, and I
couldn't find it in the manual when I was looking for it.
Code to use on:
if($HTTP_GET_VARS("fuse") == NULL) then do something; else do something
else;
Q:
Also, does anyone know how to rename a variable?
I want to create a variable $attributes_NameOfVariable, but it does not seem
to work. is there a function that exists in PHP that will assist me in this
process?
Thank you for all of your help, and thank you for your time,
August Malson