PHP unset() is an inbuilt function that terminates the specified variables. If the globalized variable is unset() inside of the function, only a local variable is destroyed. The variable in the calling context will retain the same value as before unset() was called. If the variable that is PASSED BY REFERENCE is unset() inside of a function, only the local variable is destroyed.

PHP unset Example

If we want to check if the variable is set or not then you can use the  PHP isset() function.

The syntax of PHP unset() function is following.

unset (var1, var2.... )

You can pass as many variables as possible.

#php #php unset

PHP unset Example | unset() Function In PHP Tutorial
1.80 GEEK