| |
|
PHP isset function statement script and example |
Some time we have to check the existence of a variable before using it for
our further processing. The variable can be checked by using PHP isset function
and the return value will be either true or false. Here is an example
<?
$x="some value"; // we have assigned a string to the variable $x here
if(isset($x)){ // Here we are checking
the existence of the variable by using isset function
echo "The variable exists";}
else{ echo " Variable does not exists ";}
?>
The code above will test the existence of the variable $x and since we have
declared it at first line so the PHP IF condition will return true and the
statement inside if condition will be evaluated.
This function is used in PHP LOGIN SCRIPT and PHP LOGIN LOGOUT script to
check the existence of session variables.
| |
| Subscribe |
|
Submit your email address and receive
article and product notifications. Your email is safe with us.
|
|
|
|
|
|