➤ The unset() function unsets a variable. Syntax:
unset(variable, ....); //  second parameter is optional, another variable to check
For instance:
$x = 10;
unset($x);
// False because $x is NULL
if (isset($x)) {
  echo "Variable 'x' is set\n";
}

// Declare an array
$array = array('PHP'=> true);
unset($array['PHP']); 
echo isset($array['PHP']) ? 'Array is set.' : 
    'Array is not set.';
// outputs:  Array is not set.
by Levani Makhareishvili
2 years ago
PHP
Function
1
Pro tip: use ```triple backticks around text``` to write in code fences