fm_unset


bool fm_unset ( string $name )


 

Description


Allows you to destroy an existing variable. Just like when you were young, it’s important to clean up after yourself.

 

Parameters


name (required)

The name of the variable to destroy.

 

Return


Returns true if the variable existed or false if the variable did not exist.


Errors


There are no errors for this function.

 

Example 1 - Unset a variable that exists
fm_set_variable('foo', 'bar');
echo fm_unset('foo') ? 'foo is destroyed' : 'Ain\'t no foo to destroy';
/*
Returns: foo is destroyed
*/
Example 2 - Unset a variable that does not exist
fm_unset('foo');
echo fm_unset('foo') ? 'foo is destroyed' : 'ain\'t no foo';
/*
Returns: ain't no foo
*/