![]() |
|
|
+ Search |
![]()
|
Apr 19th, 2001 09:01
Mike Boucher, Andreas Pfeiffer,
Use the isset() function to be sure that the variable is set before
using it in any functions that might cause an error.
if (isset($myVar))
{
Do stuff with $myVar;
Do more stuff with $myVar;
Do something else with $myVar;
}
if you want to do something if the variable is not set you can use.
if (!isset($myVar))
{
$myVar = "some default value";
}