Using Isset() function in php

Author - Webner

The Isset () Function:

The isset () function is used when we have to check whether a value in the variable is set or not. It returns false when variable contains null values.

For Example, values are stored in a session so that it can have access to another web page.

Code:

<?php
session_start();
$_SESSION["userid"] = "1001";
$_SESSION["flag"] = "true";

?>

Now we check whether the session values are set or not:

<?php
if(isset($_SESSION["userid"] )and $_SESSION["flag"] == "true")
{
echo ”userid”.$_SESSION["userid"];
echo ”flag”.$_SESSION["flag"];
}
?>

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *

Send your message