An issue that I have keep running into a few circumstances in getting comes about over from structures to the controller, and afterward setting off to another view, is that, for reasons unknown, the restrictive I set to go to a specific view did not work appropriately. The typical offender is the ISSET condition.
ISSET checks the variable to see if it has been set, in other words, it checks to see if the variable is any value except NULL or not assigned a value. ISSET returns TRUE if the variable exists and has a value other than NULL. That means variables assigned a ” “, 0, “0”, or FALSE are set, and therefore are TRUE for ISSET.
EMPTY checks to see if a variable is empty. Empty is interpreted as: ” ” (an empty string), 0 (0 as an integer), 0.0 (0 as a float), “0” (0 as a string), NULL, FALSE, array() (an empty array), and “$var;” (a variable declared, but without a value in a class.
some examples comparing both ISSET and EMPTY
A Variable Set to NULL
$nullVar = NULL;
if ( isset($nullVar)) -- This would be FALSE
if ( empty($nullVar)) -- This is TRUE
Non Declared Variable
if ( isset($aNonDeclaredVariable)) -- This would be FALSE
if ( empty($aNonDeclaredVariable)) -- This is TRUE
An Empty String
$singleQuoteVar = '';
$dblQuoteVar = "";
if ( isset($singlequoteVar)) -- This would be TRUE
if ( empty($singlequoteVar)) -- This is TRUE
if ( isset($dblquoteVar)) -- This would be TRUE
if ( empty($dblquoteVar)) -- This is TRUE
$zeroValue = 0;
if ( isset($zeroValue)) -- This would be TRUE
if ( empty($zeroValue)) -- This is TRUE
Hope it will Help You and please subscribe me and like my facebook page :
and make me proud.By the way if you face any problem then let me know in comment section below