unset
Free the given variable
The unset()
function clears the specified variable.
Destroy variables:
<?php $a = "Hello world!" ; echo "Delete the value of the previous variable 'a': " . $a . "<br>" ; unset ( $a ) ; echo "The value of the variable 'a' after deletion: " . $a ; ?>
Try it yourself
unset ( variable , ... . ) ;
parameter | describe |
---|---|
variable | Required. Specifies the variable to be unset. |
... | Optional. Another variable to unset. |