Unset function in php:
Unset function is also known as destroy function. It is used to remove a variable in php. Variable can be single, multiple, and an element of an array. It is a built in function in php. The unset () function takes a variable that can be deleted or destroyed.
Unset function for different variables in php:
unset($a); // remove a single variable
unset($my_array['element']); // remove a single element in an array
unset($a, $b, $c); // remove multiple variables
$myvar = "This is a string";
Above is a simple code to use unset () function in php.
This simple article tells that how we can use unset () function in php.
Uses of Unset() Function in PHP