SQL PHP HTML ASP JavaScript articles and free scripts to download If you are facing any problem in viewing this page, please tell us
 
 

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.
Further readings
Loops and program structure of PHP scripts
Checking variables by isset
switch
For Loop
if else condition checking
while loop
Do while loop
PHP beginners guide


Sections
PHP
JavaScript
ASP
HTML
SQL
Photoshop
Articles SEO
PHP Tutorials
Basic Loops
PHP Monthly Planner
PHP Introduction
Loops & structure
Array
Date & Time
Functions
Form Handling
File Handling
Math Functions
String Functions
GD Functions
Comment Posting
Content Management
PHP & Ajax
Popular Tutorials
Drop down list
File Upload
Signup script
Member Login
Line Graph
PHP MySQL Paging
PHP Calendar
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.