SQL PHP HTML ASP JavaScript articles and free scripts to download
 
 

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.

Discuss this tutorial at forum


 

Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.

Scripts
PHP
JavaScript
PHP Tutorial Index
Popular Tutorials
Drop down list
File Upload
Signup script
Member Login
Line Graph
PHP MySQL Paging
PHP Calendar
PHP Tutorials
Date & Time
Array
String Functions
Math Functions
Form Handling
File Handling
Comment Posting
Content Management
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.