×
Home About Us Products Services News Free Scripts Contact
news php scripts and software

PHP example - How to unset a global variable inside of a PHP function?


PHP - How to unset a global variable inside of a PHP function?

In order to do this the $GLOBALS array should be used, for example:
 
<?php
 
function MyFunction()
{
 unset($GLOBALS["myVar"]);
}
 
$myVar="value";
 
MyFunction();
 
?>

Category: PHP

 
<< Go back