PHP

 Home  Computers & Internet  Web Programming PHP
What is PHP?
Echo
Comments
Variables
Constants
Data Types
number_format()
Character Strings
Mathematical Operators
Comparison Operators
Logical Operators
Joining Strings
explode()
implode()
strtolower()
strtoupper()
strlen()
ucfirst()
ucwords()
strrev()
str_replace()
str_repeat()
trim()
strip_tags()
addslashes()
stripslashes()
strpos()
strrpos()
nl2br()
isset()
unset()
empty()
POST
GET
If Statements
If Else Statements
Elseif Statements
Switch Statements
For Loops
While Loops
Do While Loops
Foreach Loops
File Create
File Open
File Read
File Write
File Delete
fgets()
file_get_contents()
Date & Time
$_SERVER
Sessions
Cookies
Arrays

HOW TO USE THE isset() FUNCTION IN PHP

The isset() function is used to check whether a variable is set or not. Returns true if it is and false if it is not. Please note the the isset() function only works on variables and it's use on anything else will produce errors.

Example Usage:

<?

$username="makemyday";
if(isset($username))
{
echo "This variable is set";
}
else
{
echo "This variable is not set";
}

?>

The above will output This variable is set as the variable is indeed set.

Even if a variable stores an empty string as follows, it will still be set.

<?

$username='';
if(isset($username))
{
echo "This variable is set";
}
else
{
echo "This variable is not set";
}

?>

The above will also output This variable is set

Home | Privacy Policy | Terms Of Use | Contact Us